A passenger plane has crashed on the outskirts of Iran's capital Tehran, killing at least 39 people and injuring nine others.

The IRNA news agency said the Sepahan Airlines plane, bound for Iran's eastern city of Tabas, crashed shortly after takeoff from Mehrabad airport on Sunday morning.

A total of 48 people, 40 passengers and eight crew members, were on board when the plane crashed in the residential area of Azadi town, just 5km to the west of Tehran, IRINN state TV said.

State media had reported earlier that all 48 people onboard had died.

The Antonov-140 type plane crashed at 9.18am (04:48 GMT). IRNA's English website had earlier reported it was a Taban Airline jet.

President Hassan Rouhani has ordered a halt to all flights of the Iran-140 pending a full investigation, IRNA said.

Engine failure

A failure in one of the plane's engines caused the plane to crash on the northern side of the Tehran-Karaj highway, the semi-official Fars news agency quoted Mohammad Ilkhani, the head of Iran Airports Company, as saying.

The plane crashed into the Azadi residential block on Mina 6 Boulevard, IRNA reported. State television said at least three people in the area were taken to hospital with burns.

Mehrabad is located in a western suburb of Tehran and mainly functions as a domestic airport.

Hosseine, a local resident who witnessed the catastrophe, said the rear end of the airplane fell onto the central street after the plan lost control.

"I saw the airplane falling down gradually and then began to wobble until it lost control," he said.

"The rear end of the plane, which is separated from the fuselage, fell onto the middle of the street.

"Fortunately, there wasn't much traffic nor many people on the street."

'Refurbished' plane parts

Iran has suffered a series of aeroplane crashes, blamed on its ageing aircraft and poor maintenance.

In an interview with Al Jazeera, Emad Abshenass, an Iranian journalist, said that airlines have been forced to use "refurbished" plane parts to keep the planes flying.

Western sanctions prevent Iran from updating its US aircraft and make it difficult to get European spare parts or planes.

The country has come to rely on Russian aircraft, many of them Soviet-era planes that are harder to get parts for since the Soviet Union's fall.

The last major airliner crash in Iran happened in January 2011, when an Iran Air Boeing 727 broke into pieces on impact while attempting an emergency landing in a snowstorm in the northwestern city of Urmia, killing at least 77 people.

In July 2009, a Russian-made jetliner crashed in northwest Iran shortly after taking off from the capital, killing all 168 onboard.

In February 2003, a Russian-made Ilyushin-76 carrying members of the Revolutionary Guard crashed in the mountains of southeastern Iran, killing 302 people aboard.