Officials in Iran's judiciary canceled Shourd's release Friday, but reversed themselves Sunday on the condition that her family post $500,000 bail, according to an Iranian prosecutor who spoke to Iran's IRNA news agency.
A "bank guarantee" for the bail had been given, Shafie told ABC News.
"The case inspector informed the Tehran prosecutor of a bank guarantee concerning the posting of bail and after the prosecutor's agreement, he issued the order for her freedom," the prosecutor's website said, according to PressTV Iran.
The report did not say who was responsible for the guarantee, but two U.S. officials told ABC News Iran had received "assurances" from the country of Oman concerning the bail money.
A senior U.S. official familiar with the negotiations told ABC News Monday that the U.S. government would not be contributing any cash for Shourd's release.
Shourd faces trial for allegedly illegally crossing Iran's border, according to Iranian prosecutor Abbas Jafari Dowlatabadi.
"I think it's irrelevant whether they actually believe they have a case or not," Rudi Bakhtiar of the International Campaign for Human Rights in Iran told "Good Morning America" Monday. "I think what's important is they are going to push that case... It would make them seem weak if they turn around and say, at this point, 'Hey, we've been mistaken.'"
Shourd's release was inspired at least in part by her deteriorating health, a condition Shafie said he made clear to Iranian officials days before her release was first announced.
"I gave a letter to Tehran investigators, and I warned [them] about Sarah's situation, and that her health is very weak. They can hold them for up to a year for the investigation, but not more than a year if they haven't been given a proper trial," Shafie told ABC News through a translator last week.
On Aug. 10, the mothers of the hikers made another open plea to Iran's leaders, invoking the sacred time of Ramadan and Shourd's "serious medical condition."
"Sarah has a serious medical condition and we are gravely concerned for her physical and emotional welfare, for which Iran's leaders are responsible. We urgently call on the Iranian authorities to end her isolation and provide her with adequate care," the mothers said in a statement on a website dedicated to the hikers' release.
In an interview with "GMA" in May, Shourd's mother said she wasn't sure what she would do when finally reunited with her daughter.
"I think I'm just going to say ridiculously silly things," Nora Shourd said. "'I'm so glad to see you, sweetie. How are you? I love you.' You know, just ordinary stuff."
ABC News' Jason Stine, Kirit Radia, Sabrina Parise, Thea Trachtenberg, Kevin Dolak and The Associated Press contributed to this report.