Astonishing footage of a man scaling down a 19-storey building to escape a fire has gone viral online.

Emergency services attended a fire at an apartment building in West Philadelphia Thursday night at around 9.30 p.m, according to local station WPVI-TV.

The station’s helicopter caught the dramatic moment a man scaled down the building, climbing from balcony to balcony before making it safely to the ground.

Four residents and three police officers were injured in the blaze, the report said.

Authorities told WPVI-TV the injuries were due to smoke inhalation and heat exhaustion.

Firefighters told the station the fire started in the trash on the first floor and travelled up the trash chute. The blaze was officially placed under control at 10.56 p.m., WPVI-TV said.