The plane was headed to the eastern city of Tabas, the IRNA and Fars news agencies said, when it crashed at 9.18 am local time, after leaving Mehrabad airport.
It triggered a fireball when it smashed into the capital's Azadi neighbourhood, close to where hundreds of military families live, and only a few hundred metres (yards) from a row of shops.
Iran's deputy transport minister, Ahmad Majidi, said the Antonov An-140 turboprop plane had 40 passengers, including six children, and eight crew on board, and he put the death toll at 38.
The aircraft was operated by Sepahan Airlines and a tailfin bearing the company's dolphin logo could be seen sticking out of the road as security forces cordoned off the crash site where firefighters had doused the flames.
Black smoke billowed from the mass of burnt out twisted metal, with officials saying the plane hit a wall and trees.
"The scene was terrible, with the back of the plane in the middle of the street," one eyewitness said.
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.
"With other people, we ran to try and save the passengers but there were two or three loud explosions and a huge fire."
Mehrabad airport is near central Tehran and it is by far the country's busiest domestic hub, serving routes to all major Iranian cities.
