Two Americans jailed for spying in Iran will be released in two days, Iranian President Mahmoud Ahmadinejad has told US media.Shane Bauer and Joshua Fattal were imprisoned for eight years last month.The pair, in custody since their arrest in July 2009, had claimed they strayed into Iran accidentally while hiking near the border.An Iranian judge told the BBC he would release the men on payment of $500,000 (£316,000) bail eachDefence lawyer Masoud Shafiee says the men will then be allowed to leave Iran, Reuters reports.Mr Ahmadinejad revealed the news in an interview to be broadcast on NBC's Today show later on Tuesday.The case had heightened tensions between the US and Iran, with US Secretary of State Hillary Clinton saying she was "deeply disappointed" by the sentences.US President Barack Obama had denied the men had any link to the country's intelligence organisations.The bail sum is the same as set for the release of Mr Bauer's fiancee, Sarah Shourd, 32, who was arrested with the two men.Ms Shourd, a teacher, writer and women's rights activist, was freed in September 2010 on humanitarian and medical grounds. She did not return to face trial, saying she had suffered post-traumatic stress and would find going back to Iran "too traumatic".The couple had lived in the Syrian capital Damascus after meeting while organising demonstrations against the US-led invasion of Iraq.Mr Fattal, an environmentalist and teacher, had travelled to Damascus in 2009 to visit his friends.The trio - all graduates of the University of California, Berkeley - had gone to Iraqi Kurdistan for a week's holiday. They had visited the tourist village ofAhmed Awa, and hiked along a trail local residents had recommended, Ms Shourd said.While out walking they were stopped and arrested by Iranian troops who told them they were in Iranian territory. From / BBC