Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Support for same-sex relationships is rising sharply among all major ethnic and racial groups and most religious groups, according to a major new survey.

The American Values Atlas, conducted by the nonpartisan, nonprofit Public Religion Research Institute, comes as the Supreme Court is considering whether a Colorado baker may legally refuse to make a cake for a same-sex wedding on First Amendment grounds.

The survey found a dramatic increase in support for same-sex marriage across all racial and ethnic groups and almost all religious groups just since 2013. More than 6 in 10 — 61 percent — of Americans say same-sex couples should be able to marry legally, compared with 30 percent who are opposed. Five years ago, support was at a bare majority of 52 percent.

The survey — one of the most extensive of its kind, questioning more than 40,000 Americans in weekly installments for eight months last year — focused on issues of importance to the LGBTQ community, including same-sex marriage and protections against discrimination in housing, public accommodations and employment.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

It reported a margin of sampling error of plus or minus 1.2 percentage points, with a 95 percent level of confidence.

The Public Religion Research Institute found that supporters of same-sex marriage now make up majorities among Democrats and Republicans; blacks, whites and Latinos; Catholics; and most white mainline Protestant denominations.

Notably, opinions among black Americans have shifted from opposition — 41 percent supported same-sex marraige in 2013 — to support, with 52 percent signaling approval, the survey reported. Opposition among black Protestants has shifted especially strongly, falling from 57 percent in 2013 to just 43 percent, it said.

"The country has reached a milestone moment in the debate over LGBT rights," said Dan Cox, the institute's research director. "At a time when Americans are more divided than ever, the sea change in support for LGBT rights that now crosses lines of race, ethnicity, religion and geography means that LGBT rights are becoming one of the few areas of public agreement."

The main holdouts remain conservative Republicans. While a majority of all Republicans now support same-sex marriage — 51 percent — only 36 percent of conservative Republicans agree, according to the survey.

Perhaps not surprisingly, only two groups significantly aligned with conservative Republicanism statistically — Mormons and white evangelicals — continue to support allowing merchants to refuse to provide goods and services to same-sex couples, both at 53 percent. Black Protestants, by contrast, oppose refusing such service by almost two-thirds, the institute reported.

Jack Phillips refused to provide a cake for a gay couple from his shop, Masterpiece Cakeshop in Lakewood, Colorado. Rick Wilking / Reuters file

Opposition to refusing services spans the country, with residents of only three states falling below a majority: North Dakota and South Dakota (both at 49 percent) and Utah (48 percent).

By comparison, 60 percent of Americans overall oppose withholding service.

"While religious liberty is a widely held value, most believe that small businesses that are open to the public should serve all customers and that personal religious objections of the owners should not be allowable grounds for refusing service to gay and lesbian customers," said the institute's chief executive, Robert P. Jones, co-chairman of religion and politics for the American Academy of Religion.

Majorities of white evangelicals and Mormons may remain opposed to refusing service, Jones said, but "combined, they represent less than 1 in 5 Americans today."