An Alabama teenager claims a school resource officer attacked him in a locked cafeteria as punishment for wearing a hat indoors.

Adam Goodman said the Birmingham police officer ordered him to walk from the cafeteria at Huffman High School to another room, where he locked the door, reported WBRC-TV.

“I thought we were going to have a normal conversation about the hat but it turned out to be something else,” said the high school junior, who is black. “When I turned my back, he punched me in the head and he grabbed me and then start choking me. He threw me on the floor and start kicking me in my back.”

The attack continued until another school resource officer knocked on the door, Goodman said.

The second officer alerted the school’s principal, and the teen called his mother to tell her about the attack — which left him with a swollen eye and bruised neck.

Goodman and his mother, Erica Gibson, gave statements to the police department’s internal affairs investigators, but they were upset by the reaction.

They said police asked them not to file a report as part of an apparent coverup attempt.

“If you’re working in the school system around kids you are supposed to be there to protect and serve, not beat on no one’s child,” Gibson said. “I feel like he shouldn’t be able to work in any city school, no Birmingham school, no school system period.”

The officer was removed from the school at the start of the investigation, which remains underway.

Two civil rights groups, the National Action Network and Black Lives Matter, held a news conference Tuesday to push for a thorough investigation by the district attorney’s office and the Alabama Law Enforcement Agency.

Activists are seeking possible kidnapping and assault charges against the officer, whose name has not been released.