COLUMBIA, S.C. — A federal judge ordered South Carolina Attorney General Alan Wilson on Monday to pay more than $135,000 in legal fees for a couple who challenged the state ban on same-sex marriage.

Wilson must reimburse seven attorneys a total of $130,600 for 390 hours of work, or nearly 90 percent of what they requested. Judge Richard Gergel also awarded them the full $4,700 they sought in other court costs and fees, according to court documents.

Wilson’s office is reviewing the ruling to decide what to do next, spokesman Mark Powell said. It has 28 days to respond.

Gergel called the hours spent on the case reasonable and necessary.

Colleen Condon and her partner, Nichols Bleckley, sued last October to get a marriage license.

At the time the case was filed, Gergel noted, South Carolina was the only state in the 4th U.S. Circuit Court of Appeals to still enforce its gay marriage ban after the court found a similar ban in Virginia unconstitutional.

In his arguments against paying legal fees, Wilson called the opposing attorneys’ work excessive, especially considering other courts had already settled the issues.

“If that is so, one might reasonably ask why the state filed a 57-page brief raising a broad array of procedural and substantive issues, including a methodical attack on recent Fourth Circuit precedent,” Gergel wrote. The attorney general “cannot engage in a no holds bar defense and then complain” the opposing counsel spent too much time responding.

Gergel did offer Wilson’s office a compliment, however, saying it gave such a vigorous and passionate defense that the couple’s attorneys had to expend significant time addressing the issues.

The couple’s attorneys often worked late into the night on the case, said lawyer Malissa Burnette, who the order reimburses for nearly 100 hours of work.

“We had no choice but to research and write and defend our position,” she said. “We spent a great deal of time and had to work very hard over a short period but, ultimately, it was all worth it.”

The seven attorneys’ hourly rate ranges from $175 to $400.

In his argument against paying the fees, Wilson contended it would punish state prosecutors for doing their jobs — defending the state constitution — until the U.S. Supreme Court issued its 5-4 ruling for gay marriage in late June.

Gergel wrote that fee awards are not about punishment but rather to compensate attorneys who bring civil rights cases and win them.

“This complete litigation victory has benefited themselves and thousands of other same-sex couples in South Carolina,” he wrote.

Although a 4th Circuit decision cleared the way for gay marriages in South Carolina and other states in the circuit last year, Wilson appealed, arguing a decision by another circuit upholding gay marriage bans would have to be resolved by the Supreme Court.

© 2015, Associated Press, All Rights Reserved.

This material may not be published, broadcast, rewritten, or redistributed.