Former Costa Rican President Miguel Angel Rodriguez, who faces corruption charges, has been allowed to leave jail to be held under house arrest.
A judge fixed bail at more than $400,000 (£210,000).
The former director general of the Organization of American States (OAS) is accused of accepting a bribe while he was president.
Prosecutors have another month to bring charges against Mr Rodriguez, drop the case, or extend the investigation.
Mr Rodriguez is accused of receiving a six-figure bribe following the awarding of a contract to the French telecommunications company Alcatel in 2001.
A former telephone executive said he gave Mr Rodriguez the money as a "prize" - Mr Rodriguez said it was a loan for a political campaign.
He was arrested in October when he returned from abroad to the capital, San Jose, saying he intended to prove his innocence.
He had spent only two weeks in his job as OAS president before stepping down because of the investigation.
Mr Rodriguez was Costa Rican president between 1998 and 2002.
One of his predecessors, Rafael Angel Calderon, in office from 1990 to 1994, was also arrested in October and has been held in the same jail during an investigation into a separate corruption scandal.