Former Gov. Paul LePage's legal battles tested the limits of gubernatorial power and cost the state over $900,000 since 2014, according to The Associated Press' review of a database of state government finances.

Newly sworn-in Democratic Gov. Janet Mills comes into office with a handful of those lawsuits still pending. That includes several lawsuits between Mills and LePage over their constitutional authority, and a 2015 lawsuit pending in the 1st U.S. Circuit Court of Appeals in Boston alleging LePage abused his power by threatening to withhold state funds to thwart a Democratic opponent's job offer.

The database shows the state's general fund paid out at least $580,000 to outside lawyers who represented LePage. Maine's risk management fund paid roughly $320,000.

Observers, including lawyer Marshall Tinkle, say while LePage's "aggressive" approach to his legal fights were often unsuccessful, he largely escaped outright admonishment from courts traditionally deferential to the executive branch. Tinkle said LePage was in court more than most governors.

"To some extent, he was successful in pushing the edge of the envelope and not having a court specifically say that that was unconstitutional or going too far," said Tinkle, who wrote a book on Maine's constitution.

But, Tinkle warned, LePage's assertive use of executive power could become a precedent for future governors.

"Sometimes once there's been an aggressive interpretation of executive power by one governor, it's a lot more tempting for another governor," Tinkle said.

LePage's biggest legal battles date back to 2014, when he lost a fight to cut young adults from accessing Medicaid benefits.

In the past year, LePage found himself in court over his moves to block voter-approved Medicaid expansion, halt new wind energy projects, censor critics from his Facebook page, close down a state prison overnight and halt the flow of funds to publicly financed candidates, local job-training groups, and Mills' own office. Courts often ordered him to release state funds or follow state law, but he was left largely untouched by lawsuits over his controversial Facebook page and efforts against wind turbines.

Throughout his term, he also attacked judges, temporarily withdrew judicial nominations, threatened to halt the certification of election results and held up state funds to an independent state commission investigating religious discrimination at a Maine business. He joined out-of-state lawsuits fighting Obama's health care law and federal protections for transgender students and LGBT workers.

LePage often defended his actions as lawful and necessary to root out corruption, protect fiscal health and fight federal overreach. LePage didn't respond to a request for comment.

LePage said a Supreme Judicial Court Justice "lied" to him, and called another state judge an "activist" in a recent interview with the Morning Sentinel.

"But my opinion of the judiciary as I leave has really, really soured," LePage said. "What I've come to believe is they have tried to find a middle road."

LePage's former top in-house counsel, Avery Day, said there was a push in LePage's office to "assert" the executive branch's power. "I think this governor really tried to think about what the executive can do without having to first seek authorization, to push and expand the executive power wherever there was some gray area," Day said.

LePage's repeated failure to follow the law and attack judicial independence means courts and lawmakers should consider outlining what future governors cannot do, said attorney David Webbert, who represents former Democratic Speaker Mark Eves in his ongoing lawsuit against LePage. He described LePage's theory of Maine's Constitution as: "The governor gets to intervene in anything he wants done differently."

"Some people could look at some of the things he did and say, 'He didn't pay a price for that,'" Webbert said.

Maine's new governor faces a handful of lawsuits, including several lawsuits that LePage asked Mills to continue fighting essentially against her own administration.

LePage alleged Mills improperly joined in out-of-state lawsuits and withheld records he requested. He's argued Mills' former office should pay for his outside lawyers when she declined to represent him.

But a state judge largely agreed with Mills' arguments that Maine's attorney general is an independent constitutional officer who can determine what's in the public interest. LePage appealed her decisions, and courts in December approved motions to keep such litigation alive.

Mills, who didn't respond to a request for comment, sued LePage's administration for withholding millions in state funding from the attorney general's office. That lawsuit is pending, alongside litigation over Maine's failure to hire public health nurses.

Maine's system of checks and balances overall worked during LePage's administration, said lawyer John Brautigam, who represented clients in litigation over funding for publicly financed candidates and Maine's new ranked voting system .

"I think some of the things that he did were symbolic and did not have any practical effect," he said.