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.
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 Shiite 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 Shiite Iran and support for Sunni Islamist 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.
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.
(This story has not been edited by NDTV staff and is auto-generated from a syndicated feed.)