County clerks in Texas who have religious objections to same-sex marriage can opt out of issuing such licenses — but they should be prepared to face fines or legal challenges, Texas Attorney General Ken Paxton said in a written opinion on Sunday.

In the opinion, which is meant to serve as guidance for clerks and public officials now that same-sex marriage is legal in all 50 states, Paxton said that pro bono lawyers are ready to help such gay marriage opponents defend their decisions. But he indicated that his opinion offered no blanket protections, and said the "strength" of any claim of a religious objection was dependent "on the particular facts of each case."

"Our religious liberties find protection in state and federal constitutions and statutes," Paxton said in a statement. "While they are indisputably our first freedom, we should not let them be our last.”

As if anticipating Paxton's opinion, the American Civil Liberties Union on Friday put out a statement saying there was little he could do to keep such couples from marrying.

"Religious liberty is a fundamental right protected by the First Amendment, but that doesn't mean that government officials can use their personal religious beliefs to avoid following the law regarding marriage," said Rebecca Robertson, legal and policy director for the ACLU of Texas.

Paxton's opinion comes two days after the U.S. Supreme Court ruled that marriages between couples of the same sex cannot be prohibited by states, overriding Texas’ long-standing ban on gay marriage. In a 5-4 ruling, the high court found that same-sex couples have a constitutional right to marry and that states must license a marriage between two people of the same sex.

But as same-sex couples crowded into county clerks' offices across the state on Friday, some were unable to immediately obtain a marriage license. Some offices, including those in Travis, Bexar and Dallas counties, quickly began issuing licenses. Other counties — including Maverick, Ector, Victoria, Potter and Bastrop — said they were waiting to hear from Paxton on how to proceed.

Paxton released a statement on Thursday, ahead of the Supreme Court ruling, asking county clerks to hold off on issuing marriage licenses to same-sex couples until they received directions from his office. On Friday morning, he issued a statement condemning the Supreme Court's ruling, but did not offer any specific guidance until Sunday.

Additionally, Paxton wrote in Sunday's opinion that justices of the peace and judges could also refuse to perform same-sex wedding ceremonies. Earlier this month, Gov. Greg Abbott signed into law similar protections for clergy members.