A statement from the ministry said Qatar aimed to bolster relations between the two countries, which share the world's largest natural gas field.
"The State of Qatar announced today that its ambassador to Tehran will return to exercise its diplomatic duties," read the statement.
Row over Hajj pilgrimage helps fuel Qatar rift
Qatar was also seeking to "strengthen bilateral relations with the Islamic Republic of Iran in all fields", it added.
Doha pulled its ambassador from Tehran in January 2016 following attacks on the Saudi Arabian embassy, spurred by Riyadh's decision to execute a Shia cleric in the kingdom.
The decision to restore ties comes as Qatar is locked in a diplomatic impasse with Iran's great regional rival, Saudi Arabia, which has accused Doha of ties to Shia Iran and support for Sunni extremist groups. Qatar denies the accusations.
On June 5, Saudi Arabia, Egypt, Bahrain and the United Arab Emirates severed all diplomatic and trade ties with Qatar in what has become the worst political crisis to grip the Gulf region in decades.
Ironically, the crisis may have pushed Iran and Qatar closer together.
Mystery Qatari sheikh pushed into Gulf crisis spotlight
Qatar's move may be seen as provocative among those countries which have cut ties, but Saudi Arabia and its allies have not yet responded.
Political and business leaders in Qatar have argued that they have to maintain ties with Iran because of the gas field, which Doha calls the North Field and in Tehran is known as South Pars.
Qatar has also turned to Iran to help food imports as previously most supplies came through Saudi Arabia, which sealed off Qatar's only land border as part of the boycott.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ