Two Americans jailed in Iran as spies left Tehran on Wednesday,closing a high-profile drama with arch foe Washington that brought more than two years of hope then heartbreak for the their families as the Islamic Republics hard-line rulers rejected international calls for their release. Irans state news agency IRNA said Shane Bauer and Josh Fattal left Iran just as darkness fell in the capital. An Omani official said the men were flying to the capital,Muscat. He spoke on condition of anonymity. The case of Bauer and Fattal,who were convicted by an Iranian court of spying for the US,has deepened strains in the already fraught relationship between Washington and Tehran. Iranian President Mahmoud Ahmadinejad,who was first to mention last week the Americans could be released,is in the US for a United Nations meet. A convoy of vehicles with Swiss and Omani diplomats left Evin prison Wednesday afternoon with Shane Bauer and Josh Fattal inside. Switzerland represents US interests in Iran because the US has no diplomatic relations with Tehran. The Iranian attorney of the two men,Masoud Shafiei,said,I have finished the job that I had to do as their lawyer, Shafiei said. He obtained signatures of two judges on a bail-for-freedom deal. A $1 million bail, $500,000 for each one,was posted. Bauer and Fattal,both 29,were arrested along the Iran-Iraq border in July 2009 and sentenced last month to eight years each in prison. A third American,Sarah Shourd,was freed last year on bail. The three Americans have maintained their innocence. Their families and the US government said they were just hiking in Iraq when they accidentally strayed over the unmarked border with Iran.