Two US men given an eight-year jail term by Iran for spying have been released on bail, reports say. Shane Bauer and Josh Fattal are believed to have left Evin prison and media reports say they have been flown out of the country. The pair were arrested in 2009 after crossing into Iran from Iraq, where they said they were hiking, and were sentenced in September this year. Iran\'s judiciary reportedly set each bail at five billion rials ($500,000). The two men, both 29, left the prison compound just minutes after their Iranian attorney, Masoud Shafiei, said he had finished the paperwork for their release, obtaining the signatures of two judges on a bail-for-freedom deal. He told AFP news agency the bail funds had been provided by the state of Oman, a US Gulf ally which has good relations with Iran. The pair are believed to have been part of a convoy of Iranian, Swiss and Omani cars which left the prison shortly afterwards. State media reported that the men had already left the country, bound for Oman, but this report was denied by Mr Shafiei. He told Reuters that the men were still at the airport in Tehran, waiting to leave the country. \"Immediately after their release, the two American nationals left for Mehrabad airport,\" the official Irna news agency reported. It added that the Swiss ambassador to Tehran, who represents US interests in Iran, and a delegation from Oman were present when the hikers were released. US officials said they would only release a statement on the developments once the men had left Iran. Bauer and Fattal have always maintained they strayed into Iran accidentally while walking in the poorly-marked border region. A third American, Sarah Shourd - who was arrested with them - was freed on bail last year on humanitarian grounds and returned home. She did not return to face trial, saying the experience would have been too traumatic. Bauer and Ms Shourd became engaged while in prison. The trio were arrested in July 2009 after travelling to the Kurdistan region of Iraq for a week\'s holiday. They were stopped and arrested by Iranian troops who told them they were in Iranian territory. Bauer and Fattal were convicted in September of espionage and illegal entry. Ms Shourd pleaded not guilty in absentia but did not return to stand trial, citing ill health. The case has heightened tensions between the US and Iran, with US Secretary of State Hillary Clinton saying she was \"deeply disappointed\" by the sentences. Earlier this month, Iranian President Mahmoud Ahmadinejad had said Bauer and Fattal would be released within days, but officials later denied that any decision had been reached.The release comes a day before Mr Ahmadinejad is expected in New York for a meeting of the UN General Assembly.