The state of California has agreed not to impose greater coronavirus restrictions on church gatherings than it does on retail establishments in a pair of settlements that provide more than $2 million in fees to lawyers who challenged the rules as a violation of religious freedom.

A deal approved Tuesday by a federal judge comes after lawyers for a San Diego-area Pentecostal church took their challenge against the state to the U.S. Supreme Court three times and won.

The settlement includes a permanent injunction in line with Supreme Court rulings that found restrictions on houses of worship cannot exceed those on retail businesses, attorney Paul Jonna said.

"If they’re gonna restrict Costco to 50%, then they can do the same thing to churches," Jonna said. "But what they were doing before, as you may remember, is they were keeping those places open and they were shutting down churches — at least in California — completely."

CALIFORNIA PRINCIPAL DROPS BOMBSHELL POSSIBLE REASON FOR BEING LET GO BEFORE CONTROVERSIAL SPEECH

The settlement has little practical impact after a Supreme Court ruling led the state in April to lift limits on indoor worship. As the state’s case rate of COVID-19 has plummeted since a deadly winter surge and vaccination rates rise, Gov. Gavin Newsom is poised to lift all restrictions on June 15.

Newsom’s office issued a statement saying he put the health of Californians first when he imposed closure orders. It said the settlements provide clarity on how public health standards can be applied to churches.

Newsom was the first governor to issue a statewide stay-home order at the start of the pandemic in March 2020. His various closure orders and modifications that allowed certain businesses to open at different capacities were challenged in state and federal courts.

The public health orders were generally upheld until religious groups won a string of victories after a change in the Supreme Court makeup last year when liberal Justice Ruth Bader Ginsburg died and was replaced by conservative Justice Amy Coney Barrett.

CLICK HERE TO GET THE FOX NEWS APP

While the settlements only apply to restrictions issued for the COVID-19 pandemic Jonna said he does not believe the state would impose harsher restrictions on churches in the future because of the Supreme Court rulings.

The settlements involve a federal lawsuits brought by South Bay United Pentecostal Church in Chula Vista and Father Trevor Burfitt, a Catholic priest in Bakersfield, who sued in Kern County Superior Court.

Lawyers for the Thomas More Society, a conservative public interest law firm, will receive $1.6 million in legal fees in the South Bay case and $550,000 in the Burfitt case.