The controversial appearance of Milo Yiannopoulos at UC Berkeley met an early demise Wednesday as protesters decrying his polarizing rhetoric grew violent — breaking fences and windows, setting off fireworks and throwing smoke bombs — forcing police to discharge tear gas, issue a shelter in place and place the entire campus on lockdown.

The Berkeley Police Department said at least three or four people were injured during the protest, but did not provide details. They warned people to avoid the area of Telegraph and Bancroft avenues late Wednesday night as protesters continued to march, eventually making their way back to Sproul Plaza on the UC Berkeley campus.

Invited by the Berkeley Republican Club, Yiannopoulos, a Breitbart News tech editor and alt-right provocateur who has been criticized as racist, misogynist and white supremacist, was expected to appear in the Pauley Ballroom of the MLK Student Union at 8 p.m.[[412499523, C]]

Despite protests that started in ernest more than a month ago, campus officials decided to move ahead with the event, citing Berkeley's history as the bastion of free speech.

But on Wednesday, university officials decided to cancel the event around 6 p.m., announcing on Twitter that Yiannopoulos, a self-proclaimed internet troll who has been banned by Twitter, had been escorted off campus.

"Amid violence, destruction of property and out of concern for public safety, the University of California Police Department determined that it was necessary to remove Milo Yiannopoulos from the campus and to cancel tonight’s scheduled 8 p.m. performance," UC Berkeley said in a statement.

A group of protesters dressed in black and some in hooded sweatshirts broke windows, flung flares and set a large bonfire outside the MLK student union building.

Hundreds of peaceful demonstrators carrying signs that read "Hate Speech Is Not Free Speech" had been protesting for hours before the event. But that quickly changed when a small group yanked away metal barricades even as riot police stood guard outside the building.[[412504203, C]]

UC Berkeley police issued a dispersal order for crowds on Telegraph and Bancroft avenues which witnesses estimated had grown to more than a 1,000 people by 6 p.m.

"UC Berkeley and the UCPD went to extraordinary lengths to plan for this event and put the appropriate resources in place in order to maintain security," the university's statement said. "Multiple methods of crowd control were in place. Ultimately, and unfortunately, however, it was simply impossible to maintain order given the level of threat, disruption and violence."

After the cancellation, protesters began marching down Telegraph Avenue, chanting, "First is Milo, next is Trump." The Berkeley Police Department received reports of at least three or four injuries from fights happening in the area as well as reports of some vandalism to businesses in the area.

After protesters split off into smaller groups, some were seen smashing windows of banks at the intersection of Shattuck Avenue and Center Street. They shattered large plate-glass windows at a Chase Bank branch and at a Bank of America.

Taking to Facebook soon after being escorted from UC Berkeley, Yiannopoulos said, "I have been evacuated from the UC Berkeley campus after violent left-wing protesters tore down barricades, lit fires, threw rocks and Roman candles at the windows and breached the ground floor of the building."

The 32-year-old said he and his team members were safe and promised followers more information as it became available.

"One thing we do know for sure: the Left is absolutely terrified of free speech and will do literally anything to shut it down," he said.

Yiannapoulos continued: "Hearing reports via my security that police are using nonlethal bullets and tear gas outside. Fireworks, rocks and other projectiles have been hurled at police."

Leading up to his visit, Yiannopoulos has raised an issue facing campuses across America at the dawn of the Donald Trump presidency: What is the line between free speech and hate speech? He has also come under fire for fanning the flames of white supremacy by creating the Yiannopoulos Privilege Grant, which is being described as a college grant program for white males.[[412503813, C]]

On Wednesday, UC Berkeley officials stressed that they did not invite Yiannopoulos, a right-wing provocateur who is gay and calls his event "The Dangerous Faggot Tour."

The potential for physical danger in reaction to Yiannopoulos came into the spotlight this month after a man was shot and wounded at a protest outside his Jan. 21 University of Washington talk.

Similarly rowdy protests at UC Davis Jan. 13 prompted campus Republicans to cancel his appearance at the last minute.[[412516753, C]]

On Tuesday night at Cal Poly San Luis Obispo, his speech was met with dozens of angry protesters outside a campus theater, but they were outnumbered by police who kept them far from the nearly 500 attendees and the event went on as planned.

His last stop was supposed to be UCLA on Feb. 2, but that invitation was rescinded, making Berkeley the grand finale of his cross-country campus tour.

Student Matt Ronnau acknowledged Wednesday evening that Yiannopoulos was not too popular.

“He brings up topics that are not politically correct,” the Berkeley College Republican member said. However, the student stands by the group’s decision to invite him to speak on campus.

“I don’t think it is hate speech,” Ronnau said. “I think he is just making fun of people who call him a neo-Nazi. It’s just a little back and forth.”

Video shows protesters throwing fireworks at MLK student union building on the UC Berkeley campus.

But protest organizer Ronald Cruz disagreed. Students would oppose the right-wing Yiannopoulos not because they don’t believe in free speech, but because they were trying to prevent his hateful rhetoric.

“He’s a neo-facist who has notoriously fostered a lynch mob mentality in his audiences,” Cruz alleged.

In the run-up to the event, professors had joined hundreds of students calling for the event's cancellation. But university officials said it would be allowed in the name of free speech — as would protests that UC Berkeley Chancellor Nicholas Dirks expected could be "substantial" amid tight security.

As a public university, UC Berkeley's administrators are legally bound by the First Amendment to protect free speech, meaning even offensive and hate speech cannot be banned or censored, Dirks said.

The event's 500 seats sold out about 48 hours after the event was announced last fall, the Berkeley Republican Club said.

At the University of Delaware, Yiannopoulos referred to transgender people as "mentally ill" and encouraged his audience to mock them. He has called Black Lives Matter a form of "black supremacism." Twitter banned him in July, as it cracked down on racist abuse targeting "Ghostbusters" actress Leslie Jones.

Yiannopoulos rejects accusations he is racist or white supremacist, saying his boyfriend is black, and his humor is taken too literally in today's politically correct culture.

The Associated Press contributed to this report.