The plane was headed to the eastern city of Tabas, the IRNA and Fars news agencies said, when it crashed around 9.18 am (0448 GMT), after leaving Mehrabad airport.
But it plummeted into the Azadi neighbourhood, just west of central Tehran, close to a residential area for military families.
“All the passengers are dead,” a fire service spokesman said on IRNA.
Iran’s deputy transport minister Ahmad Majidi said the Antonov An-140 turboprop plane was run by Sepahan Airlines and it had 40 passengers, including six children, and eight crew.
An aircraft tailfin bearing Sepahan’s dolphin logo could be seen sticking out of the road as security forces cordoned off the crash site.
Black smoke billowed from the wreckage, with officials saying the plane hit a wall and trees, close to a market.
“The scene was terrible, with the back of the plane in the middle of the street,” one eyewitness said.
“We were lucky because there was a market 500 metres (yards) away and a lot of people were there.”
Another eyewitness told state television: “I was on my motorbike and I heard something behind me. I turned round and it was a plane, so I got on to the ground because it was so close.”
Mehrabad Airport is near central Tehran and is Iran’s main domestic hub and by far the busiest of the country’s airports, serving routes to all Iranian cities.
Most international flights take off from Tehran’s Imam Khomeini International Airport, which is located further west of the Iranian capital.
Alireza Jahangirian, the head of Iran’s civil aviation authority, said: “The plane crashed in trees. There were no casualties on the ground.”
The Antonov An-140 is a small aircraft designed for regional use and with a range of around 2,400 km (1,500 miles) and it can carry up to 52 people. Iranian airlines are one of the plane’s biggest users.
Iran has suffered several air crashes in recent years, blamed on ageing planes, poor maintenance and a shortage of new parts because of international sanctions.