A Chinese student has faced abuse from nationalists in China after she used her graduation address at a US university to celebrate “the fresh air of free speech”.

Yang Shuping, a psychology and theatre graduate from Yunnan province, came to study at the University of Maryland five years ago, as a dramatic clampdown on civil society and academia began back home under Xi Jinping.

During the speech at her graduation ceremony on Sunday, Yang recalled her delight at the US’s cleaner skies, saying “every breath was a delight”, and having the freedom to speak out.

“I have learned [that] the right to freely express oneself is sacred in America ... I could even rate my professors online,” she said. “My voice matters. Your voice matters. Our voices matter.”

In her eight-minute address, Yang said she had been inspired to see her American classmates vote and take part in political protests. Another inspiration was a performance of an Anna Deavere Smith play about the 1992 LA riots, in which racism, sexism and politics took centre stage.

Univ. of Maryland (@UofMaryland)

#UMDgrad student speaker: I have learned the right to freely express oneself is sacred. I learned at #UMD to speak freely. My voice matters pic.twitter.com/eKU9Ou4fXp

May 21, 2017

“I was shocked, I never thought such topics could be discussed openly .... I have always had a burning desire to tell these kinds of stories, but I was convinced that only authorities owned the narrative, only authorities could define the truth,” she said.

“Freedom is oxygen. Freedom is passion. Freedom is love. As the French philosopher Jean-Paul Sartre once said: ‘Freedom is a choice’.”

In one-party China, where there has been an intensifying offensive against free speech since Xi took power, the comments proved extremely contentious.

After a video of her speech was posted online by a Communist party newspaper on Monday and went viral, the backlash began.

Some attacked Yang, who is from Kunming, one of China’s least polluted cities, for depicting it as smog choked, even though her comments on China’s air quality appeared to be largely a political metaphor, not a reference to the environment.

In a social media post, Kunming’s government defended its “fresh and sweet” air and said the city was spring-like throughout the year.

Others accused Yang of denigrating China in online posts. “She has demonised China with the nonsense she has talked,” one person wrote.

Another said: “She has an incredible ability to lick feet. Don’t worry about coming back to China. Our motherland doesn’t need a bitch like this.”

A third called on internet users to dig up dirt on her family through a type of online campaign known in China as a “human flesh hunt”.

“Studying in the US costs a lot of money, so where is it coming from? She must come from a rich family. What on earth does her family do?” they asked.

State-run newspapers fanned the flames of the controversy. The party-controlled, nationalist Global Times quoted an anonymous student as saying that publicly talking about free speech was “immature and mean”. The student accused Yang of spreading “radical opinions”.

A second student, who also declined to give their real name, was quoted as saying: “What you gave is not free speech, but rumour mongering and favour currying ... Your freedom cannot stand, either factually or morally.”

In an apparent attempt to defuse the situation, Yang issued an online apology. “I’m sincerely sorry for the speech and hope to be forgiven,” she wrote, adding that she had not intended to “insult” her country.

The University of Maryland stood by Yang, describing her as a “top student”.

“The university proudly supports Shuping’s right to share her views and her unique perspectives, and we commend her on lending her voice on this joyous occasion,” it said in a statement.