Two tone-deaf security guards at the 9/11 Memorial got tough with some wide-eyed middle school kids visiting the city for the first time from their small town in North Carolina — because they sang “The Star-Spangled Banner.”

“You have to stop. This is considered a public demonstration!” one guard barked at the patriotic teens, their Waynesville Middle School music teacher, Martha Brown, told The Post.

The guards insisted the group needed a permit to sing, according to Brown.

“Some of the students were very upset and confused. I told the children, ‘This is a place where you need to respect authority even if you don’t understand it,’ ” she said.

The choir was wrapping up a whirlwind field trip to the Big Apple with a somber visit to the 9/11 Memorial on Friday, and had launched into their lilting version of the national anthem when the two guards cut them off.

One mom was so infuriated by the way her kid was treated that she posted footage of the truncated tribute online, where it immediately went viral and now has more than 300,000 views.