Gunfire rocked the St. John’s University campus in Queens on Wednesday afternoon during a botched, drug-related robbery inside a dorm room, law enforcement sources told The Post.

One shot was fired into the floor and no one was injured during the incident on the fifth floor of Hollis Hall around 2 p.m., sources said.

Four students were inside the room when one of them opened the door to a visitor and two other people forced their way inside, sources said.

A fight erupted, during which someone pulled the trigger on a handgun, sources said.

The intruders then ran away and were chased by campus security officers, who were joined by NYPD cops responding to a 911 call.

Three suspects were busted at 167th Street and the Grand Central Parkway, a short distance from the school.

“They were just trying to blend in with kids on the street. They didn’t run, they didn’t fight,” a source said.

Cops also seized a backpack that held two handguns and a large amount of pills, sources said. One gun was a .38-caliber revolver holding a spent round, sources said.

Those arrested were identified as Tyrell Sutton, 17, and Mustafa Godbolt, 21, both of North Babylon, LI, and Anthony Gusthas, 18, of 153-30 89th Ave. in Queens.

An investigation was continuing.