A historic highrise building in the heart of Iran's capital caught fire and later collapsed Thursday, killing at least 30 firefighters and leaving their stunned colleagues and bystanders weeping in the streets.

The disaster at the 17-storey Plasco building, inadvertently shown live on state television, came after authorities said they repeatedly warned tenants about blocking stairwells with fabric from cramped garment workshops on its upper floors.

Firefighters, soldiers and other emergency responders dug through the debris into the night, looking for survivors. While it was not clear how many people were in the steel and concrete building, witnesses said many had slipped through a police cordon while the fire burned to go back inside for their belongings.

State TV reporting dozens injured, many trapped under rubble 1:02

"They asked us ... using loudspeakers to evacuate the building, but some people went inside again, saying their precious documents, their bank cheques, their entire life was in their shops," said witness Masoud Hosseini. "They went inside to fetch those documents. I felt like they cared about their belongings, cheques and money more than their lives.

"Firefighters went inside to bring them out, and then suddenly the building collapsed," Hosseini said.

Officials have pulled the bodies of 20 firefighters from the rubble. (Vahid Salemi/Associated Press)

Iranian authorities did not immediately release definitive casualty figures, which is common in unfolding disasters.

Iran's state-run Press TV announced the firefighters' deaths, without giving a source for the information. Mayor Mohammad Bagher Ghalibaf said more than 20 bodies of firefighters had been recovered by Thursday night.

Quick collapse

Local state television said 30 civilians were injured, while the state-run IRNA news agency said 45 firefighters had been injured.

Firefighters began battling the blaze around 8 a.m., some 3½ hours before the collapse. The fire appeared to be the most intense on the upper floors, the site of workshops where tailors cooked for themselves and used old kerosene heaters for warmth.

The building came down in a matter of seconds, just as state television had begun an interview with a journalist at the scene. A side of the building came down first, tumbling perilously close to a firefighter perched on a ladder and spraying water on the blaze.

A thick plume of brown smoke rose over the site after the collapse, as onlookers wailed in grief.

Rescue workers gather in front of the Plasco building in Tehran. Some firefighters were trapped on the upper floors of the building before it collapsed. (Abedin Taherkenareh/EPA)

Tehran's Mayor Mohammad Bagher Ghalibaf said rescuers were trying to dig through the rubble to reach those trapped inside.

Among those watching the disaster unfold was Masoumeh Kazemi who said she rushed to the building as her two sons and a brother had jobs in the garment workshops occupying the upper floors of the highrise.

"I do not know where they are now," Kazemi said, crying.

At a nearby intersection, Abbas Nikkhoo stood with tears in his eyes.

"My nephew was working in a workshop there," he said. "He has been living with me since moving to Tehran last year from the north of the country in hopes of finding a job."

Cause of fire unknown

President Hassan Rouhani ordered Interior Minister Abdolreza Rahmani Fazli to investigate the disaster, IRNA reported.

Rouhani also ordered the ministry to ensure the injured were cared for and immediately compensate those affected by the fire. Rouhani, whose administration struck the nuclear deal with world powers, will probably be standing for re-election in May.

The cause of the blaze wasn't immediately known. However, fire department spokesman Jalal Maleki said authorities had visited the building often to warn tenants about conditions there.

"Everyone stacked up goods outside their shops and in the staircases and corridors," Maleki said. "We warned them many times, but they wouldn't listen."

In the hours after the collapse, authorities described the building as having a "weak structure," without elaborating.

Another fire broke out later Thursday at a building next to the collapsed tower, according to the semi-official Fars news agency. Firefighters worked into the night to extinguish it.

Iconic building

Several embassies are located near the building. Turkey's state-run news agency, reporting from Tehran, said the Turkish Embassy was evacuated as a precaution, though it sustained no damage in the collapse.

The Plasco building was an iconic presence on the Tehran skyline.

The 17-storey tower was built in the early 1960s by Iranian Jewish businessman Habib Elghanian and named after his plastics manufacturing company. It was the tallest building in the city at the time of its construction.

Elghanian was tried on charges that included espionage and executed in the months after the 1979 Islamic Revolution that brought the current ruling system to power — a move that prompted many members of the country's longstanding Jewish community to flee.

The tower is attached to a multi-storey shopping mall featuring a sky-lit atrium and a series of turquoise-coloured fountains. It wasn't immediately clear if the mall was damaged.