The five diplomats flew to Tehran from Iraq on Sunday and were met at the airport by a cheering crowd of onlookers who carried the men on their shoulders and put garlands of flowers around their necks.
Iran's Foreign Minster Manouchehr Mottaki in a news conference with the men that was carried by Iran's Press-TV minutes after their return welcomed the men back to Iran and praised what he described as their courageous resistance while being held in Iraq by U.S. forces.
The Iranians were detained in the northern Iraqi city of Irbil in January 2007. At the time U.S. authorities said the men included the operations chief and other members of Iran's elite Quds Force, which is accused of arming and training Iraqi militants. Iran denied the claim, and has described the men as diplomats who were kidnapped by U.S. forces.
U.S. officials said they handed the men over to the Iraqi government at its request because they were obliged to do so under a U.S.-Iraqi security agreement.
The U.S. State Department has said it was concerned their release could present a security threat to American troops in Iraq. The U.S. has long charged that Iran is behind much of the violence in Iraq and has been financing and assisting Shiite militias in attacks against U.S. and Iraqi forces.
Iraqi Foreign Minister Hoshyar Zebari said earlier that the transfer, part of a U.S.-Iraq security pact to hand over Iraqi and foreign detainees, would help improve dialogue between the U.S. and Iran after a decades-long adversarial relationship.
Iran and Iraq have enjoyed better relations after the U.S.-led invasion in 2003 toppled the government of Saddam Hussein, who launched an eight-year war against Iran in the early 1980s.
Many current Iraqi leaders were in exile in Iran, and still have close ties with Tehran.
The release of the five has been portrayed in Iran as a victory for the Islamic Republic at a time when the government of President Mahmoud Ahmadinejad is under domestic and international criticism following the disputed June 12 presidential election and the ensuing government crackdown on postelection protests.
The opposition claims the election, in which Ahmadinejad was declared the overwhelming winner, was fraudulent and has staged protest rallies calling for Ahmadinejad's ouster.
Iran and the U.S. have no diplomatic relations since 1979 when militant students stormed the U.S Embassy in Tehran and took Americans there hostage for 444 days.
However, Tehran and Washington held three rounds of ambassador-level talks on security in Iraq in 2007.
By Associated Press Writers Nasser Karimi and Rebecca Santana