Jacob Ostreicher hugged his wife and his lawyers after hearing the judge's ruling. The 53-year-old American had been in a medical clinic for more than a month since being weakened by a liquids-only hunger strike.
He will now be under house arrest while the authorities finish investigating his money laundering case.
Ostreicher was never charged with any crime, and the people who led his prosecution, including the No. 1 legal adviser in the Interior Ministry, are now themselves in jail, accused of belonging to a shakedown ring that authorities say preyed on people deemed to have deep pockets.
"Honestly, I wish I could tell you that I feel happy," Ostreicher told The Associated Press in a telephone interview from the clinic, where he returned on the way to his home in the city of Santa Cruz.
"Everybody around me is happy and delighted, but I feel that I have been destroyed," Ostreicher told the AP. "My family has been destroyed. I think that the damage that has been done to me is for the most part not repairable, and I guess I'm going to have to pick up the pieces. I've been in a hell for 567 days."
He thanked U.S. Congressman Chris Smith of New Jersey and Congresswoman Nydia Velazquez of New York, both of whom had visited Bolivia to press for his release.
He also thanked actor Sean Penn, who days ago made a direct public appeal to Bolivian President Evo Morales to order him freed.
Ostreicher said under the conditions set by the judge, he must remain at his home in the city of Santa Cruz during nighttime hours. He said his lawyers expect that within three or four weeks the case could be dropped.
Ostreicher arrived at Tuesday's hearing in an ambulance from the clinic. Security was tight, and he wore a bulletproof vest and a military helmet due to fears he might be attacked.
Ostreicher told reporters after the decision that he felt better and that Morales had kept a promise to have those responsible arrested. He said that many Bolivians have also been victims of similar extortion.
Ten officials have been arrested in the extortion ring that his case exposed, including two prosecutors and alleged ringleader Fernando Rivera, who had been managing Bolivia's most important prosecutions in the Interior Ministry.
Ostreicher was trying to salvage a rice-growing venture when he was arrested in June 2011.
The Orthodox Jew, who has a flooring business in Brooklyn, New York, complained from the start that he was being fleeced. His case had come to light after he accused the venture's original manager, a Colombian woman who also is jailed, of defrauding investors and falling in with a Brazilian drug trafficker.
Ostreicher says prosecutors and government employees illegally sold 18,000 metric tons of the venture's rice and stole equipment and demanded $50,000 to get him out of jail.
The AP drew attention to the case beginning last year and Smith, the New Jersey congressman, began this year to lobby for Ostreicher's release. He was moved from a prison to the medical clinic on Oct. 31 after Penn intervened on his behalf.
On Tuesday, Judge Eneas Gentilli set bail at the equivalent of $14,400.
Ostreicher said it was his 30th hearing after judges repeatedly denied his requests to be freed.
He said after the ruling that he was with his wife, Miriam Ungar, "who has been a rock, literally, throughout this ordeal."
"She held the entire family together," he said.
Associated Press writer Ian James, in Caracas, Venezuela, contributed to this report.