Jack Palkovic (above), a 21-year-old student who supports President Donald Trump, was beaten up on the University of California, Berkeley campus on Wednesday

A 21-year-old student who supports President Donald Trump was beaten up on the UC Berkeley campus less than 24 hours after violent protests led authorities to cancel a controversial speech.

Jack Palkovic says he was wearing a 'Make America Great Again' cap and on his way to class Thursday when a white SUV slammed to a stop and two young men ran toward him.

One of the men screamed, grabbed Palkovic's hat and pummeled him before the two got back in the vehicle and tried to drive away.

An Associated Press reporter witnessed the attack. Police arrived, blocked their escape and arrested both men.

Video of the incident was recorded on a cell phone by a reporter.

The footage shows Palkovic being attacked by one of the men who takes his cap.

He then gets into a skirmish with the man in an attempt to retrieve the hat.

‘I was standing at the entrance to the plaza and I was wearing the Trump hat,’ Palkovic told Jodi Hernandez of NBC Bay Area.

‘Two men that were driving north down Telegraph [Avenue] and were turning left onto Bancroft saw me wearing the hat and they parked their car in the middle of the intersection and proceeded to get out and immediately walk towards me and attempt to steal my hat.’

The student attacked at @UCBerkeley for wearing a #Trump hat describes what happened & shares his reaction. pic.twitter.com/RDlhnLkeK0 — Jodi Hernandez (@JodiHernandezTV) February 3, 2017

Palkovic says he was wearing a 'Make America Great Again' cap and on his way to class Thursday when a white SUV slammed to a stop and two young men ran toward him. One of the men in a checkered shirt is seen in the above photos accosting Palkovic

The man (far right) accosts Palkovic and begins to attack him, prompting Palkovic to retaliate

A scuffle ensues as Palkovic tries to retrieve his hat while the other man uses force to prevent him from doing so

They also ‘used physical force to keep me from trying to reach for it back,’ Pakovic said.

‘I think it’s very unfortunate that many people in our community feel like they can attack people for associating themselves with Donald Trump,’ he said.

‘I would like [the men who attacked me] to know that they may have the views that they have and I sympathize somewhat with their views, but it does not give them the right to use violence and to intimidate people with a competing perspective.’

‘I’m gonna be careful where I wear it, but I’ll wear the hat on campus and I’ll continue to make my views known.’

Palkovic says he is a member of the College Republicans group and helped organize Wednesdays' event with Milo Yiannopoulos, an incendiary right-wing commentator with Breitbart.

Palkovic takes a tumble onto the sidewalk as the two men try to flee with his red cap

Yiannopoulos said he had been planning to speak about cultural appropriation but claims his speech was over taken by the 'hard left.'

The protests on Wednesday at the nation's number-one-ranked public university were so violent that administrators warned the rest of the student body to shelter in place and the talk was eventually called off.

Protesters tore down barricades, let off fireworks and set the campus ablaze during the furious protests over the conservative Breitbart editor.

Police officers above arrest the two men on the Berkeley, California, campus after the incident

One of the men screamed an epithet, grabbed Palkovic's hat and pummeled him before the two got back in the vehicle and tried to drive away

Police arrived, blocked their escape and arrested both men. The entire incident was witnessed by an Associated Press reporter

Hundreds rallied against Yiannopoulos in a demonstration which turned violent and destructive, with protesters vandalizing dozens of businesses and smashing storefront windows.

University police locked down all buildings and responded with tear gas and rubber bullets, according to witness reports.

Yiannopoulos himself later posted a video complaining that UC Berkley was 'no friend to free speech any more.'

Palkovic (left) is a member of College Republicans, which helped organize an event on Wednesday featuring Breitbart editor Milo Yiannopoulos (right)

University police confirmed that the campus was on lockdown as they reported they were bringing in extra resources to tackle the 'violent demonstration.'

'Milo event cancelled. Shelter in place if on campus. All campus buildings on lockdown. #miloatcal,' they tweeted.

The 32-year-old right-wing provocateur is a vocal supporter of Trump and a self-proclaimed internet troll whose comments have been criticized as racist, misogynist, anti-Muslim and white supremacist.

He was banned from Twitter after leading a harassment campaign against 'Ghostbusters' actress Leslie Jones.

Hundreds rallied against Yiannopoulos in a demonstration which turned violent and destructive, with protesters vandalizing dozens of businesses and smashing storefront windows

University police confirmed that the campus was on lockdown as they reported they were bringing in extra resources to tackle the 'violent demonstration.' Shadi Banoo (above) holds a sign during the demonstrations on Wednesday

Several of Yiannopoulos' talks at other campuses have been canceled due to protests or security reasons.

The Breitbart editor wrote on Facebook that he and his team were safe after being evacuated from campus.

He also took to Facebook to criticize news sources such as CNN, sharing one of their articles titled 'Milo Yiannopoulis is trying to convince colleges that hate speech is cool' and editing it to say 'Milo Yiannopoulis is trying to convince colleges that free speech is cool.'

The rioting at Berkeley which forced the cancellation of Yiannopoulis' talk appears to have fueled soaring book sales.

He shared a link to his book, Dangerous, on Facebook with the message 'My book has soared back up to #5. Thank you for all the support. Not a bad way of showing them that violence will not win.'