When the U.S. Supreme Court ruled that same-sex couples have a constitutional right to marry, Texas’ Republican leaders responded defiantly, vowing to do their best to protect government officials who refuse to recognize gay marriage because of religious objections.

After blasting the high court’s ruling, Texas Attorney General Ken Paxton, the state’s top lawyer, issued an opinion last week saying that federal and state religious freedom laws protect county clerks, justices of the peace and judges who opt out of issuing same-sex marriage licenses or performing same-sex wedding ceremonies because they believe it violates their religious beliefs.

But the opinion came with a warning: Be prepared to get sued.

Now, conservative attorneys are gearing up to defend such government employees, saying they are confident existing laws will ensure their religious freedom. But the legal arguments they are likely to make are complex, legal experts say, and could test the courts’ capacity to balance gay rights and religious freedom.

As indicated in Paxton’s opinion, there are no blanket protections for county clerks and other government employees who reject same-sex marriage in their official capacity. Instead, the strength of religious claims is considered on a case-by-case basis.

County clerks, for example, must prove they are refusing to issue same-sex marriage licenses because doing so would violate a “sincerely held religious belief” — a legal standard courts are accustomed to considering, said Jeremy Dys, senior counsel at the Plano-based Liberty Institute, which specializes in religious freedom litigation.

Conservative attorneys suggest these cases can be resolved by guaranteeing that the government official is offered a “reasonable accommodation.” In cases of a county clerk refusing to issue same-sex marriage licenses on religious grounds, that task could be delegated to a deputy clerk or another qualified staff member who has no objections, said Mat Staver, founder and chairman of the conservative Liberty Counsel, a national nonprofit that offers pro bono legal assistance on religious freedom issues.

“What’s happening is that you’re allowing individuals to participate in the change that occurred by the Supreme Court on Friday and you’re allowing individuals who have a religious objection to be able to have that religious objection,” Dys said.

Gay rights attorneys and civil rights groups like the American Civil Liberties Union agree that there is room for religious accommodations for government officials — so long as those accommodations do not discriminate against specific groups, like same-sex couples, by intentionally burdening them.

There is a distinction between a county clerk’s freedom to express religious beliefs and the freedom to impose those beliefs on others in “the execution of their duties,” said Justin Nichols, a San Antonio-based attorney who focuses on gay and lesbian-related legal matters.

He added that reasonable accommodations for county clerks who object to issuing same-sex marriage licenses must ensure that same-sex couples still have the ability to obtain a license in their county without delay and aren’t required to travel to another county to exercise their constitutional rights.

“That’s like saying you can always get a public school education that’s not segregated if you just go to another county,” Nichols said.

Religious freedom hawks and gay rights activists are also at odds about the rights of judges and justices of the peace to refuse to perform marriage ceremonies for same-sex couples.

In his opinion, Paxton wrote that so long as other individuals authorized to perform same-sex ceremonies are willing to conduct them, judges and justices of the peace can refuse on religious grounds; they are not outright preventing a same-sex couple from participating in a ceremony.

But others asserted that the risk of litigation for judges and justices of the peace lies in picking and choosing between performing marriage ceremonies for heterosexual couples and same-sex couples.

“A judge or justice of the peace is authorized to perform a marriage but is under no obligation to do so,” Harris County Attorney Vince Ryan, a Democrat, wrote in a memo Wednesday to the county clerk, local judges and justices of the peace. “However, once the judge elects to undertake the performance of marriages, the service must be offered to all (including same-sex couples) in a non-discriminatory manner.”

Beyond the implementation of same-sex marriage in Texas, the question of how to balance religious freedom and gay couples’ right to marry is likely to end up before the high court eventually, legal experts agree.

Conservatives say the court’s ruling did nothing to take away their right to religious freedom. In fact, Dys said, the court reaffirmed the constitutional protections of religious liberty.

He pointed to Justice Anthony Kennedy’s majority opinion, in which he wrote, “It must be emphasized that religions, and those who adhere to religious doctrines, may continue to advocate with utmost, sincere conviction that, by divine precepts, same-sex marriage should not be condoned.”

But when it comes to the legal fallout from the Supreme Court's ruling, challenges to county clerks’ objections to issuing same-sex marriage licenses are only the beginning, said the Liberty Counsel's Staver.

The dissenting justices on the Supreme Court seemed to agree: Chief Justice John Roberts wrote, “Hard questions arise when people of faith exercise religion in ways that may be seen to conflict with the new right to same-sex marriage.” His examples included a religious college’s decision to only provide married student housing for opposite-sex couples or a religious adoption agency’s refusal to place children with same-sex couples.

“This is going to create a quagmire of religious freedom issues,” Staver added.

This strain between same-sex marriage and religious freedom is unlikely to fizzle out quickly, said Meg Penrose, a Texas A&M University law professor. The high court's ruling that same-sex marriage is protected by the U.S. Constitution raises even more questions about the friction between two competing constitutional rights: equal protection under the 14th Amendment and religious freedom under the First Amendment.

“The difficulty in our constitutional democracy is that when you have fundamental rights, there’s no hierarchy,” Penrose said. “So we don’t know which right ranks supreme.”

Disclosure: Texas A&M University is a corporate sponsor of The Texas Tribune. Find a full list of donors and sponsors here.