As the Supreme Court prepares to decide a key case involving states’ requirements to recognize same-sex marriage, public support for allowing gays and lesbians to marry legally continues its rapid rise: A 57% majority of Americans now favor allowing same-sex marriage and 39% oppose. As recently as five years ago, more opposed (48%) same-sex marriage than supported it (42%).

This is the highest level of support measured for same-sex marriage in nearly 20 years of Pew Research Center polling of the issue.

Yet even as support for same-sex marriage has increased among nearly all segments in the public, some groups remain broadly opposed to gay marriage. (See detailed demographic breakdowns and long-term trends on same-sex marriage.)

The Pew Research Center survey, conducted May 12-18 among 2,002 adults, finds that partisans are as divided on this issue as ever: Today, 65% of Democrats and an identical percentage of independents favor gay marriage; only about one third (34%) of Republicans do so. Growing shares of all three groups support same-sex marriage, yet the differences between Democrats and Republicans are as wide today as they were a decade ago.

However, with same-sex marriage legal in 36 states (and the District of Columbia) and the possibility of a Supreme Court decision on its nationwide status, Republicans (72%) are just as likely as Democrats (72%) and independents (74%) to say that it is “inevitable” that same-sex marriage will be legally recognized.

The fault lines on the issue of same-sex marriage extend beyond party. Other substantial cleavages include race, generation, religious beliefs and familiarity with people who are gay or lesbian.

As is the case with other demographic groups, African Americans have become more supportive of same-sex marriage over the last decade. However, overall views are mixed: 51% of blacks oppose gays and lesbians marrying legally, while 41% are in favor. Majorities of whites (59%) and Hispanics (56%) now favor same-sex marriage. The racial differences in these opinions largely persist even when taking into account other factors, such as age, religious affiliation and attendance at religious services.

A key component of the shifting attitudes on this issue is the strong support for gay rights among younger Americans. Younger generations have long been more accepting of homosexuality and of same-sex marriage than older generations, and as Millennials (who are currently ages 18-34) have entered adulthood, those views have influenced overall public opinion.

Nearly three-quarters of Millennials (73%) currently favor legal recognition, with fully 45% saying they strongly favor it. A more modest majority (59%) of Gen Xers (ages 35-50) also support same-sex marriage, while opinions among Baby Boomers (ages 51-69) are divided (45% favor, 48% oppose); among those in the Silent Generation (ages 70-87), just 39% favor same-sex marriage, while 53% oppose.

One of the strongest factors underlying views of same-sex marriage is religion, and the sense that homosexuality is in conflict with one’s religious beliefs. White evangelical Protestants stand out for their deep opposition to same-sex marriage: Just 27% favor allowing gays and lesbians to marry, while 70% oppose it (43% strongly oppose); by contrast, majorities of both Catholics (56%) and white mainline Protestants (62%) support same-sex marriage, along with an overwhelming majority (85%) of the religiously unaffiliated.

And among the one-third (33%) of Americans who feel there is a lot of conflict between their religious beliefs and homosexuality, opposition to same-sex marriage outweighs support by more than two-to-one (70% oppose, 27% favor); fully 76% of those who see no such conflict favor allowing gays and lesbians to marry legally.

But just as religious objections undergird much of the opposition to same-sex marriage, personally knowing people who are gay or lesbian is strongly linked to support for the legal recognition of same-sex marriages, as many people who have changed their minds on this issue stated in a 2013 Pew Research Center survey.

The new survey finds that nearly nine-in-ten Americans (88%) know someone who is gay or lesbian, with 28% saying they know “a lot” of gays or lesbians. These percentages are little changed from two years ago, but in 1993 a smaller majority (61%) said they knew someone who is gay.

Today, about three-quarters (73%) of those who say they personally know a lot of gays and lesbians favor same-sex marriage. A majority (59%) of those who know no gays or lesbians oppose same-sex marriage.

Overall, 54% of the public views the issue of same-sex marriage as at least somewhat important, but just 30% say it is very important. Those who oppose gay marriage (38%) are more likely than supporters (27%) to view the issue as very important.

Intensity about same-sex marriage is high – and about equally so – among those on the ends of the ideological spectrum: Four-in-ten conservative Republicans and liberal Democrats say the issue is very important.

And while 45% of those with a lot of gay and lesbian acquaintances rate this issue as highly important, only about quarter of those with fewer gay acquaintances say the same.

Other findings

Partisans rate their parties. Most Republicans and Republican leaners (57%) say their party is not doing a good job of representing their views on same-sex marriage, and the party draws criticism from those on both sides of the issue.

By contrast, 62% of Democrats and Democratic leaners say their party is doing a good job of representing their views. Democratic supporters of same-sex marriage rate their party much more positively than do Democratic opponents.

Most say gay person’s sexual orientation cannot be changed. Six-in-ten Americans (60%) say a gay or lesbian person’s sexual orientation cannot be changed; just 33% say it can. In 2003, views on this measure were divided (42% can be changed, 42% cannot).

More say people are ‘born gay.’ Nearly half of the public (47%) says that people are born gay or lesbian, while 40% think being gay is a way people choose to live; 7% say it is a result of someone’s upbringing. The share saying people are born gay has increased six points since 2013. There are stark differences between whites and blacks in these opinions. Whites are twice as likely as blacks to say that people are born gay (52% vs. 26%).