(CNN) American Muslims are growing more religiously and socially liberal, with the number who say society should accept homosexuality nearly doubling during the past decade, according to a major new survey.

American Muslims are also more likely to identify as political liberals and believe there are multiple ways to interpret the teachings of Islam, the survey found.

Conducted by the Pew Research Center , the survey of 1,001 American Muslims depicts a community in tumult, with the vast majority disapproving of President Donald Trump and worrying about the direction of the country. Even so, many remain hopeful about their future in the United States, the survey found, despite persistent anxiety about Islamic extremism and religious discrimination.

The wide-ranging survey, which was released on Wednesday, solicited opinions on everything from religious practices and politics to terrorism and social values. In addition, Pew found that the American Muslim population has been rising steadily for a decade, adding about 100,000 people per year. An estimated 3.35 million Muslims now live in the United States, just 1% of the overall population.

The survey interviews were conducted in English, as well as Arabic, Farsi and Urdu, between January 23 and May 2, 2017. The average margin of error is plus or minus 5.8 percentage points.

Some of the study's findings won't surprise people paying attention during the acrimonious 2016 presidential election, in which Trump repeatedly cast suspicion on American Muslims. Of the 44% of American Muslims who voted in the election, nearly 8 in 10 voted for Democrat Hillary Clinton. Just 8% voted for Trump.

The survey, conducted in the days and months following Trump's inauguration, portrays a Muslim community still largely wary of the President. Nearly 7 in 10 say Trump makes them feel worried, and 45% say he makes them angry. Nearly three in four Muslims say Trump is "unfriendly" toward members of their faith, and nearly two-thirds are dissatisfied with the direction of the country.

That's a stark contrast from 2011, when Barack Obama was President. Then, 64% of Muslim-Americans told Pew researchers that Obama was friendly toward Muslims and more than half were satisfied with the direction of the country.

Attitudes toward homosexuality

But the study's most significant findings may be religious and social, not political.

In 2007, just 27% of American Muslims said society should approve of homosexuality. This year, more than half (52%) said the same, a leap that surprised even scholars who study Islam in America. Likewise, 10 years ago, 57% of American Muslims said there is more than one way to interpret Islamic teachings. In 2017, 64% agreed.

American Muslims were also slightly more likely to identify as politically liberal (30% now vs. 24% in 2007). Nearly two-thirds identify as Democrats and a similar number believe in a bigger government that provides a host of services.

Asked about the essentials of the faith, an overwhelming percentage of Muslims, like Christians, said believing in God was most important. But issues like working for social justice (69%) and protecting the environment (62%) also scored high in the list of essentials for American Muslims.

There's some debate among scholars about whether American Muslims' increasing liberalism on issues like homosexuality is the result of recent immigrants' assimilation to mainstream American values or the rise of native-born millennials, who, like their non-Muslim peers, are more tolerant of the LGBT community.

But while millennial Muslims are more likely than foreign-born Muslims to say homosexuality should be accepted (60% vs. 49%), both groups saw an increase of more than 20 percentage points in the last decade, Pew found.

After a Muslim-American shot and killed 49 people at a gay nightclub in Orlando last year, American Muslims were forced to come to terms with gays and lesbians in their mosques and families, prompting conversations about homosexuality and Islamic teachings, said Zareena Grewal, who studies the American Muslim experience at Yale University.

"After the Pulse shooting, Muslims were coming out of the closet across the United States, and the Muslim community, in public and private, was grappling with the issue in a much more honest way," Grewal said.

But Ihsan Bagby, a professor of Islamic history at the University of Kentucky, cautioned about over-interpreting Muslim attitudes on homosexuality, saying many Muslims may be simply signaling support for another group often maligned in America.

"The struggle of the LGBT community has been very similar to the struggle of Muslims, and in fact the LGBT community has been very supportive of Muslims," Bagby said. But even while aligning politically, many Muslim organizations would not accept homosexualtity as an "acceptable lifestyle for Muslims," the scholar said.

A gender gap

The study uncovered a significant gender gap in the way Muslim-American men and women perceive discrimination and the country's direction.

Muslim women are more likely than men to say it is harder to be a Muslim in the United States today (57% vs. 43%); much more likely to say Trump angers them (54% to 37%); and significantly less likely to believe that Americans are friendly towards Muslims (44% vs. 65%).

That's probably because American Muslim women, particularly those who wear a hijab, are more readily recognized as Muslims and thus potentially subject to discrimination, experts said.

According to the Pew study, two-thirds of Muslim-Americans whose appearance is identifiably Muslim report experiences of discrimination, from a generalized sense of being treated with suspicion to being singled out by airport security to being attacked and called offensive names.

More likely to condemn extremism

Since the 9/11 attacks, a number of conservative commentators have condemned American Muslims for not denouncing terrorism strongly enough. In fact, Pew found that not only are Muslim-Americans increasingly anxious about Islamic extremism, they are also more likely than other Americans to say that violence can never be justified.

More than 8 in 10 American Muslims said they were at least somewhat concerned about global extremism in the name of Islam, a 10 percentage point increase from 2011, when Pew conducted a similar study.

Nearly 3 in 4 said there is little if any support for extremism among American Muslims. Just 6% said there is a great deal of support for it, and 11% said there is a "fair amount."

Likewise, more than 75% of American Muslims say violence can never be justified to further a religious, social or political cause. That's compared to 59% of Americans overall who said the same.

Silver linings

Despite the widespread belief that their community faces widespread discrimination, nearly half of American Muslims (49%) said someone had expressed support for them because of their religion during the past year. And more than half said Americans in general are friendly toward Muslims, even if also consider Islam outside of the country's mainstream.

Nearly 9 in 10 said they were proud to be both American and Muslim, and a large percentage believe that if they work hard they can succeed in the United States, the study found.

The vast majority said they were satisfied with the way their life is going, and 82% are American citizens, including 4 in 10 who were born abroad.

"Muslim Americans express a persistent streak of optimism and positive feelings," the study's authors said. "Overwhelmingly, they say they are proud to be Americans, believe that hard work generally brings success in this country and are satisfied with the way things are going in their own lives -- even if they are not satisfied with the direction of the country as a whole."