A Florida university student managed to shut down a homophobic hate preacher on her campus by following him around and playing the bagpipes over the sound of his megaphone.

Gay student Brice Ehmig said the anti-gay preacher had been shouting offensive language through a megaphone for four days on the Florida Gulf Coast University campus, and she decided to take action.

The undergrad, who also happens to play the bagpipes, followed the hate preacher around drowning out his messages with music – including playing the song 'Amazing Grace'.

She said the man had been using homophobic language and started talking about using violence against gay people, telling NBC 2: ""I just wanted to do something that made me feel brave.

"When I hear things like that, I just think about me when I was 12 and still in the closet and feeling really bad about myself. I wouldn't want her to feel bad, 12-year-old me, I need to stand up for her."

The homophobe's words were drowned out and bystanders can be heard laughing at the scene.

"If people won't turn from homosexuality there's no way they are going to come to God," the man shouted over the megaphone as Ehmig played rousing tunes on the bagpipes.

Footage of the incident has gone viral and Ehmig has received praise for taking action against the bigot – although some on campus also said he had a right to express himself.