According to the Iranian Seismological Center, the epicenter of the quake, which struck at 00:48 local time on Friday (2018 GMT on Thursday), was the northern Iranian city of Damavand in Tehran province at a shallow depth of seven kilometers.
The quake lasted several seconds, causing panicked residents to flee buildings.
Two people died and 13 others were injured while fleeing to safety, said Spokesman for Iran's Emergency Medical Services Mojtaba Khaledi.
It has been the strongest tremor to shake Tehran in over two years, when a magnitude 5.2 earthquake hit the city of Malard on the outskirts of the Iranian capital.
Iran experiences frequent seismic activity as it sits where two major tectonic plates meet.
In November 2017, Iran's western Kermanshah province was hit by a powerful 7.3-magnitude earthquake, the country’s deadliest in over a decade, which killed hundreds of people.