A recent survey by the Pew Research Center found a sizable shift in the views of American Muslims when it comes to homosexuality and found them to be more accepting of it than white evangelicals.

In a survey conducted between January and May, 52 percent of U.S. Muslims said homosexuality should be accepted by society — an increase of 25 percentage since 2007. Comparatively, only 34 percent of white evangelical Protestants said they believed homosexuality should be accepted, the smallest percentage of any group surveyed.

Within the U.S. Muslim community, women and college graduates had the highest acceptance rate of homosexuality (both 63 percent), followed by less religious Muslims (62 percent) and millennials (60 percent).

While results found that acceptance of homosexuality in the U.S. Muslim community corresponds with wider acceptance in the U.S. general public, there remained generational differences in acceptance within both populations. Researchers found younger U.S. Muslims are more accepting of homosexuality than their older counterparts. Within the U.S. Muslim community, 60 percent of millennials said homosexuality should be accepted in society — 14 percentage points fewer than the general millennial population in 2016. In contrast, the U.S. Muslim "Baby Boomer or older" demographic had a 42 percent acceptance rating of homosexuality in 2017, 11 points lower than the general population’s acceptance rate around the same time.

White mainline Protestants had the highest acceptance rate of homosexuality, with 76 percent saying it should be accepted by society — a 23 percent jump from a decade prior.

Follow NBC Out on Twitter, Facebook and Instagram