The suspected gunman in Wednesday’s deadly school shooting in Florida is a “troubled” former student obsessed with firearms — who was once identified as a potential threat to his fellow classmates, according to a report.

“I stayed clear of him most of the time,” said one teen, who spoke to WSVN , but didn’t give his name.

“He’s been a troubled kid, and he’s always had a certain amount of issues going on,” the boy explained. “He shot guns because he felt it gave him, I guess, an exhilarating feeling. He showed me [his guns] personally through his phone.”

The alleged shooter — identified as Nikolas Cruz, 19 — had even “joked” about taking out his schoolmates on several occasions, the student said.

“He played around with the joke multiple times,” the teen said. “You know, he knows the layout of the school. He can actually go ahead and he can pinpoint where all the students would be. He’s been through the drills multiple times.”

Cruz had been banned from carrying a backpack on the campus of Marjory Stoneman Douglas High School in Parkland, Fla., due to his alleged issues, the Miami Herald reports

“We were told last year that he wasn’t allowed on campus with a backpack on him,” math teacher Jim Gard, who taught Cruz last year, told the newspaper.

“There were problems with him last year threatening students,” he said. “I guess he was asked to leave campus.”

According to Gard, school officials had sent out an email last year — warning teachers about Cruz and the alleged threats he was making against other students.

Broward County School District Superintendent Robert Runcie, however, says this didn’t happen.

“We received no warnings,” he told reporters Wednesday during a press conference.

“Potentially there could have been signs out there,” he said. “But we didn’t have any warning or phone calls or threats that were made.”

Cruz’ classmates insist, though, that he was a well-known threat to the school.

“A lot of people were saying it was going to be him,” a student told WFOR-TV.

“A lot of kids threw jokes around saying that he was going to be the one to shoot up the school,” they said. “It turns out that everyone predicted it. That’s crazy.”

Matthew Walker, a junior, told ABC News that Cruz would often flash knives and guns he owned on social media.

“Everything he posts is about weapons,” Walker said. “It’s sick.”

Broward Sheriff Scott Israel said Wednesday evening that investigators had begun “dissecting” Cruz’ social media pages in search for clues about a potential motive.

“Some of thing that come to mind are very, very disturbing,” Israel told reporters, in reference to Cruz’ posts.

While school officials confirmed that Cruz used to attend Marjory Stoneman, they declined to say when exactly. He was expelled for “disciplinary reasons,” but it’s unclear when.

A student named Nicholas Coke, who was interviewed at the scene, told WSVN that Cruz left Marjory several months ago and moved to North Florida after his mother passed away.

“He had a lot of problems in middle school,” Coke said, describing Cruz as a “loner.”

Law enforcement sources told The Post that the young man was a member of the US Army Junior Reserve Officers’ Training Corps program (JROTC).

“My time in alternate school, I did not want to be with him at all because I didn’t want to cause any conflict with him because of the impression he gave off,” his former classmate told WSVN.

Cruz was reportedly wearing a gas mask and carrying smoke grenades during his alleged massacre. He was able to get away momentarily by blending in with other students as they fled the school. Cops later apprehended him without incident.

Additional reporting by Larry Celona