"The Iraqi foreign ministry takes this opportunity to ask neighbouring countries to respect Iraqi sovereignty and not interfere in her internal affairs," the foreign ministry statement added, hoping for "continuing good relations with Iran".

'US embarrassment'

Hasan Kazemi Qomi, Iran's ambassador to Iraq, was quoted by the IRNA news agency as saying the release was an embarrassment for the US force in Iraq.

"Fortunately with the effort exerted by the Iraqi officials, the US forces who firstly denied their arrest were obliged to admit it and under pressure from the Iraqi government to release them," he said.

"The arrest of these diplomats was carried out contrary to international laws and the Geneva convention," Kazemi Qomi said.

"No foreign factor can impede the current existing friendly relation between Iranian and Iraqi officials... And I on behalf of my country's officials am grateful for the Iraqi officials' effort," he added.

Release

The handover took place in the presence of Mowaffaq al-Rubaie, Iraq's national security adviser, Iranian state television reported. Al-Rubaie refused to confirm or deny this.

The US military press office in Baghdad referred questions about the Iranians to the office of the secretary of defence in Washington, which did not immediately respond to an inquiry.

On Wednesday, military spokesman General William Caldwell said US forces were holding two Iranian nationals detained last week in the Iraqi capital on suspicion of weapons smuggling.

"There was an operation on the morning of December 21 based on intelligence. We conducted a raid on a site in Baghdad," Caldwell told reporters.

Interrogation

Ten people were arrested in the raid and "documents, maps, photographs and videos" were seized which, he said, linked them to "illegal activities". After interrogation it was discovered that two of the 10 were Iranians.

A US military statement said: "Debriefing of the detainees and investigation of the seized materials has yielded intelligence linking some of the individuals being detained to weapons shipments to illegal armed groups in Iraq."

Jalal Talabani, the Iraqi president, who invited the two Iranians to Iraq as part of an agreement between the newly forged allies to improve security, was said to be "unhappy with the arrests".