Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A scheduled speech by controversial Breitbart editor Milo Yiannopoulos at the University of California, Berkeley led to violent protests that caused the event to be called off, the university said.

The university said fires were set, including one caused by a firebomb that ignited a generator-powered spotlight, and commercial-grade fireworks were thrown at police. NBC Bay Area showed a group of people grab a metal barricade and smash it against a door.

"The violence was instigated by a group of about 150 masked agitators who came onto campus and interrupted an otherwise non-violent protest," UC Berkeley said in a statement. Some people were attacked and police treated six people for injuries, the university said.

This might be what shut down #miloatcal: fire alarms in MLk Student Union, then protestors smashing doors with police barriers @nbcbayarea pic.twitter.com/oV21mdDSiV — Raquel Maria Dillon (@RaquelMDillon) February 2, 2017

Yiannopoulos said on Facebook that he was evacuated and blamed "violent left-wing protesters."

The university said the event was called off at around 6 p.m. local time "amid violence, destruction of property and out of concern for public safety," and estimated 1,500 people were outside the venue.

UC Berkeley police said multiple dispersal orders were given for the protest and people were told to leave campus or avoid the area. A campus lockdown was declared. A witness said a large crowd at Sproul Plaza yelled “No Trump, no Milo” and police used a megaphone to announce the event was called off.

"We condemn in the strongest possible terms the violence and unlawful behavior that was on display and deeply regret that those tactics will now overshadow the efforts to engage in legitimate and lawful protest against the performer’s presence and perspectives," UC Berkeley said in a statement.

The fire is out now. People just milling around, listening to drummers. But this is what it looked like #MiloAtCal @UCBerkeley @nbcbayarea pic.twitter.com/lsIeNLNbBS — Raquel Maria Dillon (@RaquelMDillon) February 2, 2017

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Yiannopoulos' critics say he has a history of making offensive comments related to race and religion. He made headlines earlier this year after he was banned from Twitter following online harassment of "Ghostbusters" star Leslie Jones.

Berkeley announced on Twitter at around 6:20 p.m. local time (9:30 p.m. ET) that the event was canceled. Marchers moved off campus, with some chanting "open borders for us all, no bans no walls," according to NBC Bay Area.

At around 10 p.m. local time, campus officials lifted a "shelter in place" order issued during the height of the protests and said routine campus business and classes would be held as normal on Thursday, the university said.

PHOTOS: Violent Berkeley Stymie Breitbart Editor's Talk

"The Left is absolutely terrified of free speech and will do literally anything to shut it down," Yiannopoulos said on Facebook after the Berkeley event was canceled.

UC Berkeley Police Chief Margo Bennett said Wednesday night she wasn't aware of any arrests by the department. Officers used pepper balls and marking paint balls but no tear gas was used. "I believe our officers exercised tremendous restraint," she said.

Protesters watch a bonfire on Sproul Plaza during a rally against the scheduled speaking appearance by Breitbart News editor Milo Yiannopoulos on the University of California at Berkeley campus on Feb. 1. Ben Margot / AP

It’s the second time a planned event featuring Yiannopoulos was canceled due to protests. A Republican college group called off an event at UC Davis on Jan. 14 amid protests.

Berkeley protest organizer Ronald Cruz earlier told NBC Bay Area that demonstrations would be held to oppose what he characterized as hateful rhetoric.

"He’s a neo-fascist who has notoriously fostered a lynch mob mentality in his audiences," Cruz told the station.

UC Berkeley said in a statement after the event was canceled that extra officers were deployed and "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,” the college said.

Milo protesters in Berkeley shatter the front windows of Chase Bank on Shattuck and enter the building. https://t.co/CiCELujvnF pic.twitter.com/zG59HmGfP4 — NBC Bay Area (@nbcbayarea) February 2, 2017

Berkeley College Republicans said before the protests that a "groupthink phenomenon" has taken hold at the California university that silences conservative speech, and while it doesn't agree with everything Yiannopoulos has said or done "we saw the chance to host Milo as an opportunity that was too good to pass up."

"He is somebody who stands up for those who are too afraid or intimidated to speak out on campus, and he voraciously defends speech from all sides of the political spectrum,” the group said in a statement earlier.

A bystander who said he was attacked by protesters looks for cover after a protest at UC Berkeley, after a scheduled speech by Breitbart News editor Milo Yiannopoulos was canceled, in Berkeley, California, on Feb. 1, 2017. NOAH BERGER / EPA

After the violence, the group said in a statement: "The Free Speech Movement is dead. Today, the Berkeley College Republicans’ constitutional right to free speech was silenced by criminals and thugs seeking to cancel Milo Yiannopoulos' tour."

University officials had rejected prior calls to cancel the event, citing free speech.

"We regret that the threats and unlawful actions of a few have interfered with the exercise of First Amendment rights on a campus that is proud of its history and legacy as home of the Free Speech Movement," the university said.

Hundreds of peaceful protesters demonstrated for hours before the event, some with signs that read "Hate Speech Is Not Free Speech," The Associated Press reported.

President Trump on Thursday morning, tweeted about the event, and even threatened to take away funding from the school.

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

"If U.C. Berkeley does not allow free speech and practices violence on innocent people with a different point of view - NO FEDERAL FUNDS?" he posted.