About half of research at Berkeley is funded by the federal government, according to the university website. Berkeley however has been struggling in the past years with budget shortfalls and spending deficits.
Trump's top political adviser Stephen Bannon is the former chairman of Breitbart News.
If U.C. Berkeley does not allow free speech and practices violence on innocent people with a different point of view - NO FEDERAL FUNDS?— Donald J. Trump (@realDonaldTrump) February 2, 2017
Yiannopoulos, Breitbart's technology editor, is a flamboyant firebrand reviled by his critics as racist and misogynistic but who casts himself as a gay crusader against "political correctness."
He is often portrayed as a leader of the so-called alt-right - a white nationalist fringe that has found a home on Breitbart's pages - although he has sought to distance himself from the movement.
He is however a vocal supporter of Trump - nicknaming the billionaire "Daddy" during his election campaign.
The 32-year-old Briton is probably best known for inciting a campaign of online abuse against the African-American "Ghostbusters" actress Leslie Jones. Twitter banned him in July.
The Berkeley event was to be the last stop of a college speaking tour that has drawn big crowds and also sparked fistfights, a shooting and at least one other cancellation.
According to an article on Breitbart News, Yiannopoulos was planning to use the event to launch a campaign against so-called sanctuary campuses, which have declared their opposition to Trump's tough stance toward undocumented immigrants.
Yiannopoulos said on Facebook he was evacuated "after violent left-wing protestors tore down barricades, lit fires, threw rocks and Roman candles at the windows and breached the ground floor of the building."
"One thing we do know for sure: the Left is absolutely terrified of free speech and will do literally anything to shut it down."
UC Berkeley, one of the top public universities in the United States, is the home of the 1960s "Free Speech Movement" that helped launch the era's student protests against the Vietnam War.
The mayor of Berkeley, one of America's most liberal cities, deplored the violence by a "small minority" of protesters.
They "provided the ultra-nationalist far right exactly the images they want to use to discredit the vast majority of peaceful protesters in Berkeley and across America who are deeply concerned about where the country is heading," said Jesse Arreguin, the mayor.
Similar protests at the University of California at Davis last month also forced the cancellation of speeches by Yiannopoulos and Martin Shkreli, a former pharmaceuticals boss who became a hate figure after jacking up the price of a life-saving drug.
The events at Davis and Berkeley were organized by conservative student groups. A similar invitation to speak at UCLA was rescinded. Officials at the three University of California campuses stressed that they did not invite Yiannopoulos or endorse his ideas but were committed to free speech.
More than 100 UC Berkeley faculty members had signed two letters sent last month to the school's chancellor, urging him to cancel the event.
"Although we object strenuously to Yiannopoulos's views - he advocates white supremacy, transphobia and misogyny - it is rather his harmful conduct to which we call attention in asking for the cancellation of this event," read one of the letters.
They cited as one example an incident in December at the University of Milwaukee where Yiannopoulos openly mocked a transgender student, displaying her name and photo on screen.