Violent protests erupted on Wednesday at the University of California at Berkeley over the scheduled appearance of a controversial editor of the conservative news website Breitbart.

Hundreds of students and other protesters chanting "shut him down", smashed windows at the campus, set wooden pallets on fire and threw fireworks and rocks as police in full riot gear responded with tear gas.

The university was placed on lockdown as the sold-out appearance by Milo Yiannopoulos, a conservative firebrand, was cancelled early in the evening.

Yiannopoulos, who is technology editor for the news website, is known for his provocative social media posts and was banned from Twitter in July for fueling abuse directed at Ghostbusters actress Leslie Jones.

The British journalist is a vocal supporter of Donald Trump - nicknaming the US president "Daddy" during his election campaign - and has become one of the faces of America's "alt-right" movement.

Al Jazeera's Rob Reynolds, reporting from Los Angeles, said that it is an extreme pushback by liberals in the US against right-wing figures.

"It should also be noted that Berkeley has a centre of protest dated back to the Vietnam war, so it's not surprising that he won't be a welcomed figure," he said.

"He was invited by the campus Republican club, but he has now cancelled his speech for security reasons, as fire was set at the university."

Similar protests at the University of California at Davis last month also forced the cancellation of speeches by Yiannopoulos and former pharmaceutical executive Martin Shkreli.

READ MORE: Sexual assault in the time of Trump

The events at Davis and Berkeley were organised by conservative student groups. A similar invitation to speak at UCLA was rescinded and Berkeley was to be the last stop of Yiannopoulos' tour.

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' 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 - a gay crusader against "political correctness" - openly mocked a transgender student, displaying her name and photo on screen.