GAINESVILLE, Fla. — A man in a swastika T-shirt wandered into an angry crowd of anti-white-supremacist protesters in Gainesville on Thursday, where he got jostled, punched, and — of all things — hugged.

The skinhead, whose white T-shirt featured multiple gray swastikas, found himself in the midst of an angry crowd at the University of Florida in Gainesville.

Some 300 protesters had gathered there to demonstrate against white supremacist Richard Spencer, who was giving a speech at the student center.

The mob surrounded the skinhead; video of the encounter recorded shouts of “F— you!” and “Leave him alone!”

“Speak your mind,” one protester demanded of the silent man. “Everybody hates you.”

Someone swung at the skinhead, bloodying his nose.

Then, something wonderful: An African-American man approached the skinhead, chest to chest, and demanded, “Give me a f’in hug.”

“Why you don’t like me, bro? Huh? What is it? What is it?”

The skinhead first grimaced, as if bracing for more violence, then relaxed, smiled slightly, and hugged back.

And shrieking cheers rose up from the mob.

Speaking inside the student center, Spencer was getting a worse welcome: Protesters inside the auditorium drowned him out with continual shouts of “F— you!” and “Go home!” and even, “Let’s go, Gators!”

Additional reporting by Laura Italiano