A teenage boy police were trying to arrest fell six stories off a building roof and was critically injured, and detectives from the Internal Affairs Bureau were investigating, police said Friday.

The 17-year-old boy was shuffling backward as two uniformed officers told him not to move Thursday night before he stepped over a 3-foot ledge, apparently believing it was connected to the neighboring rooftop, top New York Police Department spokesman Stephen Davis said. The boy, whose name wasn't released, fell down an air shaft.

A 14-year-old companion grabbed the boy's shirt as he fell but couldn't hold on, and the officers ran to the 14-year-old to keep him from falling also, Davis said.

"It appears that the kid misjudged the wall and where it led to," Davis said.

The teens were confronted by police after a man leaving the Bronx building complained that a group of teenagers was smoking marijuana in the lobby, Davis said.

The officers, who were on their way to man foot posts at the beginning of their tour, entered the building, and a group of teens ran up the stairs, he said. The 17-year-old and his 14-year-old friend, who were sitting in a nearby stairwell, also ran up the stairs, he said.

When the teenagers reached the rooftop, some of them jumped over a small wall to a neighboring rooftop and got away, Davis said. But the 17-year-old and the 14-year-old ran in a different direction on the roof, apparently pinning themselves in, he said.

The officers, who joined the police force in July 2013, did not have their guns drawn at the time, Davis said.

One officer called an ambulance after the boy's fall and tried to give him CPR, Davis said.