PHILADELPHIA (WPVI) -- A SEPTA police officer is credited with foiling an attempted burglary in the city's Frankford section early Sunday.

It happened around 1:40 a.m. on the 1500 block of Pratt Street.

Police said the officer noticed two men on the roof of a check-cashing business.

The SEPTA police officer contacted officers from the 15th district and a perimeter was established around the building to prevent the men from exiting the roof, police said.

A fire truck and police helicopter were also called to the scene.

SEPTA officers climbed the roof and encountered a man with a backpack on the roof. Police said the man refused to come down from the roof, and began running from roof to roof but eventually he was caught and taken into custody.

Police said tools were recovered on the roof of the check-cashing place where the man was attempting to gain access.

In addition, police said they recovered a stolen car in the 1500 block of Pratt Street, a black Ford Fusion.

Police said as they were taking the man they caught on the roof into custody, a second man walked up and got into the stolen Ford Fusion. Officers moved in and took that man into custody as well.

According to police officers did not find a second individual on the roof and investigators are working to determine if the man who got into the black Ford Fusion was involved with the burglary attempt.