In this May 21, 2010 file photo, American hikers Shane Bauer, left, and Josh Fattal are shown in Tehran, Iran. The lawyer for two Americans jailed as spies in Iran says a $1 million bail-for-freedom deal has been approved by the courts, clearing the way for the release of the men after more than two years in custody. Masoud Shafiei says he plans to go to Tehran's Evin prison later on Wednesday Sept. 21, 2011 to begin the procedures for the release of Shane Bauer and Josh Fattal. (AP Photo/Press TV, File)
TEHRAN, Iran — The lawyer for two Americans jailed as spies in Iran said they will be released Wednesday after more than two years in custody following a court approval of a $1 million bail deal.
The Iranian attorney Masoud Shafiei said he planned to go to Tehran's Evin prison to begin the procedure for the release of Shane Bauer and Josh Fattal.
"The case is over," Shafiei said. "The court has ordered that they be freed on bail," he added.
The two were arrested along the Iran-Iraq border in July 2009 and sentenced last month to eight years each in prison. A third American arrested with them, Sarah Shourd, was freed last year on bail.
Shafiei said he would meet the two Americans at 3 p.m. local time at Tehran's Evin prison. Swiss diplomats were standing by at the prison, waiting to pick up the two Americans. Switzerland represents American interests in Iran because the U.S. has no diplomatic relations with Tehran.
The case of Bauer and Fattal, who were convicted of spying for the United States, has deepened strains in the already fraught relationship between Washington and Tehran. Iranian President Mahmoud Ahmadinejad, who was first to mention last week that the Americans' could be released, is in the United States and is scheduled to speak at the United Nations General Assembly on Thursday.
Shafiei said the bail of $500,000 for each of the men was posted after some last-minute bank problems were resolved. He did not say who put up the money.
"There is no obstacle to their freedom now," the lawyer said. "It's only a matter of time before they are out of jail," he added. "They can go to the U.S. the way Sarah did."
The release of the pair will likely follow the pattern of Shourd's release last September after a $500,000 bails was posted. She was then flown on a private plane to the Omani capital Muscat.
Last week, Oman dispatched a plane belonging to the Gulf country's ruler to fetch the two Americans if the freedom-for-bail was reached.
Omani officials declined to comment on the ongoing proceedings for the Americans' release. They only said the private plane, sent from Muscat to the Iranian capital last Wednesday, was still in Tehran.
The officials spoke on condition of anonymity because of the sensitivity of the issue.
Oman has close ties with both Tehran and Washington and plays a strategic role in the region by sharing control with Iran of the Strait of Hormuz at the mouth of the Persian Gulf, which is the route for 40 percent of the world's oil tanker traffic.
The three Americans — friends from their days at the University of California at Berkeley — have maintained their innocence and denied the espionage charges against them.
Their families and the U.S. government say they were just hiking in northern Iraq's scenic and relatively peaceful Kurdish region when they may have accidentally strayed over the unmarked border with Iran.
Since her release last year, Shourd has lived in Oakland, Calif. Bauer, a freelance journalist, grew up in Onamia, Minn., and Fattal, an environmental activist, is from suburban Philadelphia.
Bauer proposed marriage to Shourd while in prison.
Phone messages left for Fattal's mother and brother in Philadelphia were not immediately returned Wednesday.
It was not clear where the two men will be reunited with their families after their release. The last direct contact family members had with Bauer and Fattal was in May 2010 when their mothers were permitted a short visit in Tehran.