Hillary Clinton addressed Wellesley college graduates and asked them to get politically involved and engaged with their communities.

New York: Hillary Clinton launched a stinging attack on fake news and delivered veiled barbs against President Donald Trump on Friday, returning to her alma mater to give graduates a rallying call for action.

"You are graduating at a time when there is a full-fledged assault on truth and reason. Just log on to social media for 10 seconds it will hit you right in the face," she said in a commencement address at Wellesley College in Massachusetts.

"Some are even denying things we see with our own eyes, like the size of crowds," she said alluding to but not naming Trump, who falsely accused the media in January 2017 of misrepresenting the size of his inauguration crowds.

"Then defending themselves by talking about quote unquote alternative facts," she added. "When people in power invent their own facts and attack those who question them, it can mark the beginning of the end of a free society."

The former Democratic nominee, the only woman in US history to win a major party nomination for president, graduated from the liberal women's arts college in 1969.

She lost the election to Republican billionaire Trump in November 2016.

Clinton implicitly compared Trump to Richard Nixon, saying that she and her classmates were "furious" 48 years ago about the election "of a man whose presidency would eventually end in disgrace with his impeachment for obstruction of justice."

She called Trump's proposed budget "an attack of unimaginable cruelty on the most vulnerable" which she said "grossly underfunds" public education, mental health, efforts to combat America's opioid epidemic and threatens to worsen climate change.

But the bulk of her speech was a rallying cry for graduates to get politically involved and engaged with their communities.

"The future of America, indeed the future of the world, depends on brave, thoughtful people like you insisting on truth and integrity," she said.

"In the years to come, there will trolls galore, online and in-person, eager to tell you that you don't have anything worthwhile to say or anything meaningful to contribute, they may even call you a nasty woman," she said.

"You don't have to do everything, but don't sit on the sidelines."