FRANKFORT, Ky. — Kentucky’s Republican governor and Democratic attorney general have filed dueling lawsuits over whether the government should have let a Louisville law firm share in a $24 million state settlement against OxyContin-maker Purdue Pharma.

Republican Gov. Matt Bevin’s administration filed a lawsuit Tuesday asking a judge to order the law firm formerly known as Dolt Thompson Shepherd & Kinney to return the $4.2 million it received as part of the settlement.

Democratic Attorney General Andy Beshear also filed a lawsuit Tuesday. It asks a judge to block the Bevin administration’s efforts to recover the money because it threatens a settlement with one of the world’s largest drug companies along with the state’s “future contractual relationships.”

The lawsuits mark the fifth time Bevin and Beshear have taken a dispute to court. Beshear is a likely candidate for governor in 2019, when Bevin could run for re-election.

The Dolt Thompson law firm had a contract to represent the state in a lawsuit against Purdue Pharma, which alleged that the company lied about the addictive nature of its drug OxyContin. That contract expired on June 30, 2015, and was not renewed. Six months later, former Democratic Attorney General Jack Conway settled the lawsuit for $24 million.

Beshear took office in January 2016. His office discovered the contract with the law firm had expired by mistake. They issued a new contract to the firm, allowing it to be paid $4.2 million from the $24 million settlement. Months later, Conway joined that firm as a partner. The firm then changed its name to Dolt Thompson Shepherd and Conway.

“Because Dolt Thompson’s contract had expired, it had no right to receive $4.2 million from the Purdue Pharma settlement,” attorneys for Finance and Administration Cabinet wrote in the complaint. “Conway appears to have agreed to the settlement to pave the way to his entering the Dolt Thompson law firm after he left state government.”

But Beshear’s lawsuit says the Attorney General’s Office issued the new contract because that’s what the Bevin administration told them to do. His lawsuit includes emails and documents indicating the Finance and Administration Cabinet instructed Beshear’s office not to extend the old contract, but to issue a new contract so the law firm could be paid its fee plus expenses.

Documents show the cabinet approved the contract on Feb. 1, 2016.

“This new attack is both silly and petty,” Deputy Attorney General J. Michael Brown said. “Having a judge rule in this matter is the quickest and most transparent way to resolve it.”

Asked if he approved the new contract for the law firm in 2016, Finance and Administration Secretary William Landrum said “The lawsuit filed yesterday speaks for itself.” In that lawsuit, attorneys argue the February 2016 contract was not valid because it pertained to a settlement that was to happen in the future, “not one that had already happened.”

“This constitutes a knowing, intentional, and gross misuse of state funds entrusted to the Attorney General,” attorneys wrote in the complaint.

Tyler Thompson, the law firm’s registered agent, said his firm’s work on the case included reviewing 10 million pages of documents and conducting a deposition of Richard Sackler, a former president of Purdue Pharma and a member of the family that controls the company.

“We had a contract, we did the work, we got an incredible result for the state of Kentucky,” Thompson said. “We’ll just let it play out in the courts. I’d be shocked if there is any merit to it.”

The $24 million settlement for Kentucky was the largest for a single state against Purdue Pharma. Purdue Pharma settled a lawsuit with the U.S. government for $634 million, and almost all of that award went to the Medicaid program. Twenty-six states settled a similar lawsuit for a total of $19.5 million in 2007.

But former Democratic Attorney General Greg Stumbo said Kentucky’s case was worth at least $1 billion. And Conway had said publicly the case was worth at least $100 million. That’s one reason why the Bevin administration says the settlement was “not reached in good faith, was unlawful, and violated Attorney General Conway’s obligation to faithfully represent the interests of the citizens of Kentucky.”

Thompson said Conway did not profit from the settlement when he joined the firm.