The US military in Iraq has released nine Iranians detained there, including two held on suspicion of helping Shia militants, it has said in a statement.
The release followed a review of their cases which concluded that the men no longer posed a security risk and were "of no continued intelligence value".
The Iranians were released to the Iraqi government, which will later transfer them to the Iranian embassy in Baghdad.
Tehran has dismissed US accusations that it is aiding fighters in Iraq.
In October, the US declared the overseas operations arm of the Iranian Islamic Revolution Guards Corps (IRGC) a "supporter of terrorism", saying it was supplying and training Shia militants in Iraq.
'Careful review'
Two of those freed on Friday were among five Iranian officials detained by US forces in an "intelligence-driven raid" on an office in the same building as the Iranian consulate in the Kurdish city of Irbil in January.
Their detention has been the subject of intense protests by the Iranian government and lobbying by Iraqi authorities.
The Kurdistan Regional Government (KRG) also objected, saying the office and its personnel were known to them.
The other seven Iranians being freed had been picked up in different parts of the country and held for periods ranging between three months and three years.
The US military said two of the men were captured "during a raid to disrupt al-Qaeda operations", while another was held after a raid "aimed at capturing a senior insurgent".
"The release followed a careful review of individual records to determine if they posed a security threat to Iraq, and if their detention was of continued intelligence value," the military said in a statement.
"Based on this review, all nine individuals were determined to no longer pose a security risk and to be of no continued intelligence value."
The Iranian embassy in Baghdad intends to return the men to Iran immediately, the statement added.
The BBC's Jim Muir in Baghdad says the releases, although they leave a further 11 Iranians still in detention, might be seen as heralding something of a thaw between the US and Iran - at least in Iraq.
US military commanders have hinted they are beginning to sense a greater effort by Iran to stop weapons and explosives crossing the border, BBC correspondent says.
PHOTO CAPTION
Iranian consulate in Irbil