A similar arrangement led to the release of a third hiker, Sarah Shourd, who is already home.
ABC News confirmed an announcement from Iranian president Mahmoud Ahmadinejad that said the hikers, Josh Fattal and Shane Bauer, would be released in two days.
The U.S. State Department has been monitoring developments, and families are just hoping that this time, they are not disappointed.
In Washington, Secretary of State Hillary Rodham Clinton said the United States was "encouraged" by Ahmadinejad's comments about freeing Bauer and Fattal.
"We obviously hope that we will see a positive outcome from what appears to be a decision by the government," Clinton said at the State Department.
The last time the hikers saw loved ones was May 2010. The mothers of Fattal, Bauer and Shourd had lobbied intensely to get a mere 90 minutes with the captives. Shourd was released four months later for health reasons with a bail payment of $500,000.
Throughout their imprisonment, it has been one setback after another. One of the worst points was just last month, when Fattal and Bauer were sentenced to five years in prison for spying and an additional three years for entering the country illegally.
The three Berkeley graduate students were arrested in 2009 while hiking near a waterfall in the semiautonomous Kurdish region of northern Iraq. The trail is unmarked and at some point goes back and forth over the Iran-Iraq border.
In Tehran, the attorney for the two men says the court has accepted a deal for release. That processing will continue as long as the bail payment is made - $1 million for the two of them.
The Associated Press contributed to this story.