|Shane Bauer and Josh Fattal have been in an Iranian jail for more than two years [AFP]
President Mahmoud Ahmadinejad has said that Iran would release two US citizens imprisoned for spying in a "couple of days'" on bail, which their lawyer said had been set at $500,000 each.
"I am helping to arrange for their release in a couple of days so they will be able to return home. This is of course going to be a unilateral humanitarian gesture," Ahmadinejad told The Washington Post on Tuesday.
"It is a unilateral pardon", he added.
Asked by the Post how the pair would return to the US, Ahmadinejad said that "they are free to choose".
In a separate interview with the US network NBC, he said Shane Bauer and Josh Fattal would be released "in two days", but their lawyer Masoud Shafiei said they would be freed only when the bail had been paid.
Bauer and Fattal were arrested in July 2009 near Iran's border with Iraq, where they say they were hiking in the mountains. They were sentenced last month to eight years in prison on spying charges.
A third American, Sarah Shourd, was freed on bail on humanitarian and medical grounds in September 2010 and returned home.
"While we do not have further details at this time, we are overjoyed by the positive news reports from Iran," a statement issued by the families said.
"We're grateful to everyone who has supported us and looking forward to our reunion with Shane and Josh. We hope to say more when they are finally back in our arms."
In the NBC interview, Ahmadinejad highlighted what he said was the way Iranians suffer in American jails.
"Do you know how many Iranians are now in American jails?" he said. "It's not only about two people in Iran. These two people are having very good conditions here in prison. It's like staying in a hotel."
Bauer and Fattal, who share a cell in Tehran's Evin prison, were convicted at a trial held behind closed doors in August.
Their supporters say evidence against them has never been made public.
US President Barack Obama has denied that the two men, who were working in the Middle East when they were detained, had any link to US intelligence.
Reacting to the news on Tuesday, US Secretary of State Hillary Clinton said: "We have followed this very closely and we are encouraged by what the Iranian government has said today.
"We obviously hope that we will see a positive outcome from what appears to be a decision by the government".
The affair has heightened tensions between Tehran and Washington, which severed diplomatic ties after the storming of the US embassy in the wake of the 1979 Islamic Revolution.