Iraq has announced that its own president, Jalal Talebani, mediated the discussions that will bring about the imminent release of Shane Bauer and Josh Fattal, two American imprisoned in Iran.

Mohammad Majid Al-Sheik, the Iraqi ambassador to Iran, told the Shargh daily: “After receiving a request from the families of the two accused, Jalal Talebani contacted Iranian top officials to mediate and call for their pardon and release.”

He added: “Talebani finally managed to bring them onside and obtain the pardon for Shane Bauer and Josh Fattal.”

On Tuesday, just before his trip to New York to attend the UN General Assembly, Mahmoud Ahmadinejad announced in an interview with NBC that the two detained U.S. citizens, accused of espionage in Iran, would be released in the next two days.

Massoud Shafii, the defence attorney for Bauer and Fattal, also reported that his clients would soon be released on bail, adding that he had informed the families and the Swiss Embassy that the two can return to the U.S. after putting up bail of $500,000 each.

U.S. Secretary of State Hillary Clinton says the U.S. is encouraged by Iran’s decision to release the two Americans.

Bauer and Fattal were sentenced to eight years in prison last month on charges of “illegal entry and spying for U.S. agencies.”

The two Americans were arrested along with a third companion, Sara Shourd, in July of 2009 in the Iran-Iraq border region. They always claimed to have inadvertently strayed into Iranian territory and deny the espionage charges.

Shourd was released on a similar bail last September on medical grounds.