Image copyright Getty Images Image caption These Muslims celebrated Eid al-Fitr, the end of Ramadan, in Pittsburgh, Pennsylvania

Almost half of Muslims in the US say they have experienced discrimination in the past year, a study by the Pew Research Center suggests.

Three quarters say there is "a lot" of discrimination against Muslims, while 74% say President Donald Trump is "unfriendly toward" them.

In 2011, 64% said President Barack Obama was "friendly toward" them.

The research also suggested that Muslims in the US are becoming more socially liberal.

The proportion saying society should accept homosexuality has almost doubled.

Researchers spoke to 1,001 US Muslims by phone. They said the people they chose were a representative sample.

More discrimination - but more outward support too

Half of those they spoke to said it had become harder to be a Muslim in the US in recent years, while 48% said they had personally experienced discrimination in the past year.

The most common form of discrimination cited was being treated with suspicion (32% of those the researchers spoke to), followed by being singled out by airport security (19%), being called offensive names (18%), being singled out by law enforcement (10%) and being physically threatened or attacked (6%).

Some felt unsafe as a result, with one immigrant man saying: "We have to take extra care scanning our surroundings, know where we are, who is around and what kind of thoughts they might hold for Islam."

Those with a distinctively Muslim appearance - for instance clothing like a hijab - were more likely to say they had experienced discrimination. In fact Muslim women were more likely than Muslim men to say it had become more difficult to be a Muslim in the US.

The numbers for all of these forms of discrimination had gone up since 2007, when George W Bush was president, but most had decreased or stayed level since 2011, under President Obama.

At the same time, there was evidence of growing vocal support for Muslims.

Almost half (49%) said someone had expressed support for them because of their religion in the last year.

Unhappy with the way the country is going

A majority of Muslims voted for Hillary Clinton, so perhaps it is no surprise that they are unhappy with the team that is now at the top. But their experiences of discrimination, and President Donald Trump's attempts to restrict entry for people coming from Muslim countries, have coloured this too.

Media playback is unsupported on your device Media caption Muslim students on Trump ban: "I have seen two sides of America"

One man said: "When the Muslim ban was introduced the first time around, I literally felt like the persecution had started. Because we had read the history of Europe and what happened to the Jewish people in Germany."

Another said: "You almost get that post-9/11 atmosphere because of the suppression, really, of minorities and minorities' thoughts and voices.

"People like the alt-right or ultraconservative Trump supporters now have a larger voice that was suppressed just years ago, and now they're really allowed to make heard what they think about Muslims and minorities in general, so a lot of tensions have been rising."

More socially liberal than before

US Muslims' views on homosexuality have changed in the last decade. This year, more than half (52%) said society should accept homosexuality - up from 27% in 2007.

The leap corresponded with a smaller bump in the number of US Muslims saying there is more than one way to interpret Islamic teachings. In 2007, 57% agreed with this liberal view; this year, the figure was 64%.

Views on terrorism and extremism

Muslims were more likely to condemn terrorism than the general US population.

They were asked the following question: "Some people think targeting and killing civilians can be justified in order to further a political, social or religious cause. Other people believe that, no matter what the reason, this kind of violence can never be justified. How do you personally feel?"

75% of Muslims said it could never be justified, while just 59% of the general public said the same.

Some people from both Muslim and non-Muslim backgrounds said they thought it was often or sometimes justified. To try and understand the answer better, the researchers rang some of those people back and asked them what they meant. Many of them mentioned situations other than terrorism, including military action and self-defence.

Three quarters of Muslims said they saw little or no support for extremism among US Muslims, and 6% said they saw a "great deal". The general public were more likely to perceive Muslims as supporting extremism.

And Muslims were more likely than the general public to be concerned about extremism in the name of Islam, in the US and around the world.

Do Muslims think they fit in to American life?

Most Muslims think they are not seen as being part of the American mainstream, and 60% thought their coverage in the mainstream media was "unfair".

But 92% said they were proud to be American. 89% of respondents said they were both proud to be a Muslim and proud to be American.

One woman in her 40s told researchers: "What I have in common with most Americans is a dedication to this country.

"We also have in common our shared humanity.

"We're all struggling to earn, pay our taxes and raise our kids."

Pew Research Center estimates that there are 3.35 million Muslims of all ages in a US, a million more than there were in 2007. A majority of Muslim adults were born outside the US, in more than 70 different countries of origin. On the whole they are younger than the general US population.