LOUISVILLE, Ky. – Kentucky must pay $224,000 in legal fees related to former county clerk Kim Davis' refusal to issue marriage licenses to same-sex couples, a federal appeals court ruled Friday.

Davis, the former Rowan County clerk, was successfully sued by several couples in 2015 for refusing to follow the U.S. Supreme Court's ruling establishing a right to same-sex marriage.

In 2017, a federal district judge held that the couples suing Davis for marriage licenses clearly prevailed and that the state of Kentucky must pay their legal fees and costs.

While Gov. Matt Bevin has personally supported Davis, once calling her "an inspiration ... to the children of America," his lawyers argued in January that Davis should foot the legal bill, not the state.

On Friday, a three-judge panel for the U.S. 6th Circuit Court of Appeals in Cincinnati upheld the district judge's ruling that the state of Kentucky must pay the $224,000 in attorney fees and costs incurred by the same-sex couples.

Kim Davis:Governor who praised clerk in gay marriage protest wants her to pay state's legal fees

The governor's outside counsel, Palmer G. Vance II, declined to comment Friday on the appellate court ruling, deferring to Bevin's office.

In a previously filed brief, Vance wrote that Davis' local policy "defied the unequivocal mandate issued by the Supreme Court" and the state's "interest in upholding the rule of law."

“As a result, the Commonwealth cannot bear liability for any attorneys’ fees related to challenges to the legality of this local policy," Vance wrote.

"We respect the court’s decision," a Bevin spokesman said in a statement.

In Miller v. Davis, which involves eight people who sued Davis over not receiving marriage licenses, the appellate judges agreed with U.S. District Judge David Bunning's ruling in 2017 that said the state, not Davis or Rowan County, was liable because the state is primarily responsible for regulating marriage.

Bunning had said that Davis, a Republican, was protected because she was acting in her official capacity when she ignored court orders to issue licenses to same-sex couples following the U.S. Supreme Court's 2015 ruling allowing gay marriage.

In a separate opinion that involves the case of two other couples, the judges agreed Friday that Davis has sovereign immunity as a public official but not qualified immunity as an individual.

Judges noted the second case is still in an "early stage" and that a district court has yet not awarded any damages.

Davis declared she was acting "under God's authority" when refusing to issue the marriage licenses in 2015 to same-sex couples in the Eastern Kentucky county, a stance that garnered international attention.

Kim Davis:Kentucky official who denied same-sex marriage licenses, loses re-election

Davis spent five days in jail for refusing to issue the licenses and was freed only when a judge ordered her deputies to issue the licenses without her approval.

After the General Assembly passed a law dropping a requirement that marriage licenses bear the signatures of clerks, Davis said she no longer objected to issuing the same-sex licenses.

Davis was defeated by a Democratic challenger, Elwood Caudill, in her bid for re-election in November 2018.

The American Civil Liberties Union, which represented the couples who were denied licenses by Davis, celebrated the appellate court's ruling Friday.

"By affirming the sizeable fee award, the Court also sent a strong message to other government officials in Kentucky that it is not only unconstitutional to use public office to impose one’s personal religious views on others, but that it also can be a very expensive mistake," William E. Sharp, an attorney for the ACLU of Kentucky, said in a statement.