Donald Trump has nominated Judge Neil Gorsuch to the Supreme Court, seizing an unusual early opportunity to put conservatives back in the majority on America's top court.

US President Donald Trump has raised the threat of pulling federal funds from the University of California at Berkeley after the institution cancelled a talk by provocateur Milo Yiannopoulos and put the campus on lockdown after intense protests against the planned speech.

While Trump framed his early-morning tweet around free speech and opposition to violent demonstrations, his critics are likely to interpret the message as indirect support for Yiannopoulos, a polarising figure who portrays himself as a champion of open expression. His detractors view him as a hatemonger.

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

CARLOS BARRIA / REUTERS Donald Trump appeared to threaten to cut the university's funding over a row regarding freedom of speech.

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

READ MORE:

* Trump defends 'tough' phonecalls

* Trump's calls to fellow world leaders

* US media stunned Trump picked fight with Australia

* Turnbull learns Donald Trump doesn't 'make nice'

Yiannopoulos echoed that sentiment.

DREW ANGERER Milo Yiannopoulos was due to make a speech at Berkeley and has also weighed in on the freedom of speech row.

"UC Berkeley should have all federal funding cut until it can demonstrate its commitment to the First Amendment and guarantee the safety of libertarian and conservative speakers on campus - and the safety of their audiences. Nothing less will do."

Berkeley is the flagship school in the University of California's public university system. Student loans and grants make up the vast majority of federal funding to colleges and universities, along with grants for research given by institutions such as the National Institutes of Health.

California Lt. Gov. Gavin Newsom reacted on social media:

KEVIN LAMARQUE Trump appeared to suggest that cancelling the speech was a violation of freedom of speech.

"As a UC Regent I'm appalled at your willingness to deprive over 38,000 students access to an education because of the actions of a few."

Yiannopoulos writes for the Breitbart website, which was led by Stephen Bannon, a key Trump adviser.

Yiannopoulos has a large following as a self-proclaimed "free-speech fundamentalist" crusading against political correctness. He was banned from Twitter last summer after sending tweets targeting actress Leslie Jones, who is black.

REUTERS The UC Berkeley campus was put on lockdown after intense protests against a planned speech from Milo Yiannopoulos. FILE PHOTO.

Some schools have cancelled or indefinitely postponed events featuring Yiannopoulos because they often generate such intense responses. In January, a man was shot and seriously wounded as fights broke out during one of those events at the University of Washington.

When the events are cancelled, some call it censorship. Others counter that universities aren't required to pay security and other expenses for speakers invited by student groups.

"The event has been canceled," the 32-year-old Yiannopoulos posted on his Facebook page. "I'll let you know more when the facts become clear. One thing we do know for sure: the Left is absolutely terrified of free speech and will do literally anything to shut it down."

Free speech is an exceptionally volatile issue right now, with debate over code words, safe spaces, implicit bias and microaggressions on campuses across the country. Yiannopoulos's events are flash points, and his cross-country tour touched off intense opposition Wednesday in Berkeley.

The Daily Californian, the student newspaper at Berkeley, reported that protesters were chanting, "No Milo, no Trump, no fascist USA," setting off fireworks, throwing rocks and bricks and pounding on windows. The paper reported that university police used rubber bullets and tear gas in an attempt to disperse the crowd.

"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," the university announced Wednesday night. The decision was made about two hours before the event to a crowd of more than 1,500 protesters gathered outside the venue.

Berkeley's administration said it went to "extraordinary lengths" to plan for the event, working with the Berkeley College Republicans and adding crowd-control measures and dozens of additional police officers.

Security officials said that about 150 "masked agitators" joined the demonstration, setting fires, throwing Molotov cocktails and rocks and attacking some members of the crowd. Officers from the city of Oakland and Alameda County arrived at 7:45 p.m. to help the university and Berkeley city police. There were no immediate reports of arrests or serious injuries. The "shelter in place" order was lifted about 10 p.m., although campus police warned that protests were still going on in the surrounding community and advised people to avoid neighbouring streets.

Campus officials said in a statement that "they 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 the home of the Free Speech Movement."

The demonstrators included "Black bloc" protesters, who wear masks and black clothing to present a unified front as they disrupt events, making it difficult for police to recognise individuals in the group.

They are often seen at protests organised by groups such as Black Lives Matter and Occupy Wall Street, destroying property and setting fires.

They torched a limousine in Washington last month on the day of Trump's inauguration, and a group spray-painted buildings and smashed electrical boxes during a demonstration in Portland, Ore., earlier in January. When a group of them arrived at Berkeley, it swiftly changed the tenor of the peaceful demonstration.

Some at Berkeley were worried that Yiannopoulos was using the event to begin a campaign against "sanctuary campuses" and that individual students would be identified and targeted as examples of illegal immigration.

A story posted Tuesday on the Breitbart website announced that "MILO and the David Horowitz Freedom Center have teamed up to take down the growing phenomenon of 'sanctuary campuses' that shelter illegal immigrants from being deported.

MILO will kick start the campaign with a speech at the University of California's Berkeley campus on February 1, where he, backed by the Freedom Center, will call for the withdrawal of federal grants and the prosecution of university officials who endanger their students with their policies . . ."

More than 100 faculty members signed two letters to Berkeley Chancellor Nicholas Dirks. One said: "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."

The faculty members said that Yiannopoulos "has labeled Black Lives Matter a form of 'black supremacism' and argues that the protest movement should be labeled a 'terrorist organization'; he refers to principles of diversity at college campuses as 'anti-White racism.' He has also denounced rape culture as a myth propagated by feminists 'aimed squarely at undermining masculinity.'"

They noted that Yiannopoulos sometimes singles out people on campus and cited an event in Milwaukee when he projected an image of a transgender student on a screen.

"Yiannopoulos's views pass from protected free speech to incitement, harassment and defamation once they publicly target individuals in his audience or on campus, creating conditions for concrete harm and actually harming students through defamatory and harassing actions. Such actions are protected neither by free speech nor by academic freedom."

Nils Gilman, associate chancellor and chief of staff to Dirks, responded that while the administration was sorry that some speakers would upset some people on campus, "our Constitution does not permit the university to engage in prior restraint of a speaker out of fear that he might engage in even hateful verbal attacks."

That debate - forms of which are playing out on campuses across the country - has particular resonance at Berkeley, where the Free Speech Movement began in 1964. Some members of that original movement wrote an op-ed in the Daily Californian defending Yiannopoulos's right to speak:

"Yiannopoulos is a bigot who comes to campus spouting vitriol so as to attract attention to himself.

"His modus operandi is to bait students of color, transgender students and anyone to the left of Donald Trump in the hopes of sparking a speaking ban or physical altercation so he can pose as a free speech martyr. His campus events are one long publicity stunt designed to present himself as a kind of hip, far right, youth folk hero - sort of Hitler Youth with cool sunglasses."

The Berkeley College Republicans, who sponsored the sold-out event, had explained that while they don't agree with everything Yiannopoulos says and "totally disavow" any violence that might result from the event, they wanted to offer a chance for people to consider alternative viewpoints. ". . . a peculiar groupthink phenomenon has formed here in Berkeley, where, in the eyes of many, there can be no viable solution to any problems we face other than the ones the progressive left has to offer," the executive board wrote.

"The Free Speech Movement is dead," the group wrote on social media after the protests.

"Today, the Berkeley College Republicans' constitutional right to free speech was silenced by criminals and thugs seeking to cancel Milo Yiannopoulos' tour.

"Their success is a defeat for civilised society and the free exchange of ideas on college campuses across America. We would like to thank UCPD and the university administration for doing all they could to ensure the safety of everyone involved. It is tragic that the birthplace of the Free Speech Movement is also its final resting place."