Within hours of the Supreme Court decision legalizing same-sex marriage, an array of conservatives — including the governors of Texas and Louisiana — and religious groups called for stronger legal protections for those who want to avoid any involvement in same-sex marriage, like catering a gay wedding or providing school housing to gay couples, based on religious beliefs.

They demanded establishing clear religious exemptions from discrimination laws, tax penalties, or other government regulations for individuals, businesses, and religious-affiliated institutions wishing to avoid endorsing such marriages.

Gov. Greg Abbott, R-Texas, issued a directive to state agencies saying employees should not be penalized for refusing to act in violation of their beliefs.

“No Texan is required by the Supreme Court’s decision to act contrary to his or her religious beliefs regarding marriage,” he said in a statement.

Gov. Bobby Jindal, R-La., a Catholic who is a candidate for president, warned the court decision “will pave the way for an all-out assault against the religious-freedom rights of Christians who disagree.”

Jim Daly, president of Focus on the Family, a prominent conservative Christian group based in Colorado Springs, Colorado, said he was worried Christians would be subjected to “prejudice and persecution” if they stood against same-sex marriage. He suggested a variety of issues were likely to be litigated, including whether the ruling would force Christian universities to house same-sex couples in dorms for married students and whether cake makers and florists would have to work same-sex weddings.

“To me it’s a mind-boggling maze of treacherous future court cases,” Daly said.

Justices on both sides of the issue seemed to anticipate the battles ahead and address them.

In his majority opinion, Justice Anthony M. Kennedy stressed individuals were free to defend traditional beliefs about marriage, but he played down any potential conflicts, writing, “The First Amendment ensures that religious organizations and persons are given proper protection as they seek to teach the principles that are so fulfilling and so central to their lives and faiths.”

But Chief Justice John G. Roberts Jr., dissenting, 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 — when, for example, a religious college provides married student housing only to opposite-sex married couples, or a religious adoption agency declines to place children with same-sex married couples.”

“There is little doubt that these and similar questions will soon be before this Court,” Roberts wrote, adding, “Unfortunately, people of faith can take no comfort in the treatment they receive from the majority today.”

In a telephone news conference, Archbishop William E. Lori of Baltimore, chairman of the religious liberty committee of the US Conference of Catholic Bishops, said Kennedy’s majority opinion made “a nod in the direction of religious liberty, but not enough of one.”

“Of course we retain the right to think what we want and say what we want and preach what we want about marriage,” he said.

“But the free exercise of religion means we have the right,” Lori continued, “to operate our ministries and to live our lives according to the truth about marriage without fear of being silenced or penalized or losing our tax exemption or losing our ability to serve the common good.”

“We serve millions of people every day, and we do it well, we do it lovingly and it would be a shame to see it jeopardized, to see it swallowed up in this decision,” he said.

Religious groups that continue to oppose same-sex marriage include the Roman Catholic Church, conservative evangelical churches (like the Southern Baptist church), Orthodox churches, the Church of Jesus Christ of Latter-day Saints (known better as the Mormon church), Orthodox Judaism, and Islam. Many other religious groups support same-sex marriage, as do countless members of the groups that oppose it.

Gay rights advocates argue religious institutions are well protected by the First Amendment; no church can be forced to hire a gay pastor and no pastor can be forced to preside at a same-sex wedding. But they balk at permitting discrimination against gay people or couples by businesses that serve the public or by government-funded entities like foster care agencies.

“Same-sex couples exercising their constitutional freedom to marry should not be shunned by commercial businesses for any reason,” said Susan Sommer, director of constitutional litigation for Lambda Legal, a gay rights group.

Early tests of religious rights and discrimination may come in the few states, mainly in the South, where some county clerks have said they will not issue same-sex marriage licenses. In North Carolina, where several county magistrates resigned last fall rather than abet same-sex marriages, a law has been passed to allow such refusals.

The federal government and about 20 states have versions in place of the Religious Freedom Restoration Act, which requires courts to balance possible infringements on religious beliefs against compelling state interests. The laws were originally intended to protect religious minorities against inadvertent discrimination — just this month under the federal law, a Sikh college student won the right to keep his long hair and turban while participating in ROTC.

But recently proposed versions, including the original bill in Indiana and one that was vetoed by the governor of Arizona in 2014 after a similar uproar, seem intended to authorize discrimination against gay people by businesses, rights groups said. Civil rights groups also became more wary of such laws last year when the Supreme Court, in the Hobby Lobby case, said a closely held private corporation could in effect have religious beliefs.

This month, in anticipation of the legal acceptance of the marriage ruling, Sen. Mike Lee, R-Utah, and Rep. Raul Labrador, R-Idaho, introduced the First Amendment Defense Act, which would push federal law far beyond the existing religious protections. Sure to be opposed by civil rights groups and most Democrats, the bill would prohibit federal officials from penalizing individuals, businesses, charities, or schools for actions based on a conviction that marriage is between a man and a woman.