By the CNN Wire Staff
September 14, 2010 -- Updated 1336 GMT
Tehran, Iran (CNN) -- Sarah Shourd, one of three American hikers detained for more than a year in Iran, has been released from prison, her lawyer told CNN on Tuesday.
Attorney Massoud Shafii, who is representing the hikers, had said everything was in place for Shourd's release once bail of $500,000 was submitted to the Iranian judiciary.
Tehran Prosecutor General Abbas Jafari Dolatabadi told state-run television that "representatives" of Shourd paid her bail to an Iranian bank in Muscat, Oman, after which a judge ordered her release Tuesday.
"She can leave Iran if she wants to," Dolatabadi said.
A diplomat at the Swiss embassy told Press TV that Shourd would be leaving Iran later Tuesday.
Shourd, 32; Shane Bauer, 28; and Josh Fattal, 28, were detained July 31, 2009, after they allegedly strayed across an unmarked border into Iran while hiking in Iraq's Kurdistan region.
Tehran has accused the three hikers of spying.
As the news of Shourd's release unfolded, a spokeswoman for the families of the hikers, Samantha Topping, said the families had heard nothing officially.
"We don't have any confirmation of Sarah's release. The families are watching news reports," she said.
A judge decided to allow Shourd to be released on bail because of her medical condition, the official Islamic Republic News Agency reported Sunday, citing Tehran Prosecutor General Dolatabadi.
Shourd had a pre-existing gynecological problem, and her family says she now also has a lump in her breast, according to Shafii.
Iranian officials have apparently changed their stance on Shourd's release several times since last week.
Iranian officials had announced Thursday that Shourd would be released on Saturday, at the end of the Islamic holy month of Ramadan. But state media announced Friday that the release had been called off because legal procedures had not yet been resolved.
On Sunday, Dolatabadi announced the country's "readiness for the conditional release of one of the three U.S. citizens arrested for illegally entering the country," state-run Press TV said.
"It's hard to say what's behind the twists and turns of this," U.S. State Department spokesman P.J. Crowley told reporters Monday. "Our focus is on getting the hikers home, as it has been for more than a year."
Gary Sick, a professor at Columbia University and a former National Security Council Iran analyst, said it was not a coincidence that the latest news came just as Iranian President Mahmoud Ahmadinejad is about to attend the United Nations General Assembly meeting later this month.
"I think President Ahmadinejad really wanted to use this as a way of building up a store of goodwill just before he comes to New York," Sick said. "It didn't work that way, and I think that his plans were really screwed up by that fact that all of these hard-liners in Iran, the conservatives that are supposed to be his friends, are all attacking him left and right."
Dolatabadi said Sunday that authorities had completed investigations on espionage charges against the three Americans over the past several days and the indictments have already been issued by the judge in charge of the case, IRNA reported.
But Crowley said Monday that the United States remains firm in its belief that the hikers are innocent.
"We do not believe that they are guilty of any crime. Iran has had more than enough time to investigate and satisfy its questions about why these three individuals crossed an unmarked border," he said. "We want to see this resolved. We are grateful to the Swiss and other countries that are working these issues on our behalf."
The Swiss have been representing American interests in the case in the absence of formal U.S.-Iran diplomatic relations.
The hikers' families' website, freethehikers.org, said Shourd had been in solitary confinement and had been able to meet for only two 30-minute periods per day with Bauer, who is her fiancé, and Fattal. The two men share a cell.
The site also includes an August 10 letter -- signed by the mothers of all three hikers -- urging Iranian officials to release them.
"Shane, Sarah and Josh are spending their second Ramadan in detention. Today is also Sarah's birthday -- her second in solitary confinement. Sarah has a serious medical condition and we are gravely concerned for her physical and emotional welfare, for which Iran's leaders are responsible," the letter says. "We urgently call on the Iranian authorities to end her isolation and provide her with adequate care."
On Monday, Shafii had said he was waiting for the Swiss Embassy to deposit the bail money, the semi-official Iran Students' News Agency reported.
"During my meeting with the client's family, we agreed to take measures for her release as soon as the money is provided," he said, according to the agency.
CNN's Mary Snow, Reza Sayah and Catherine E. Shoichet contributed to this report.