Former Nicaraguan President Arnoldo Aleman has been released from prison to house arrest because of ill health.
The former president faces a range of corruption charges
A judge ruled that Mr Aleman - charged with fraud and money laundering - could return to his ranch near the capital, Managua, while awaiting trial.
The judge, Juana Mendez, said Mr Aleman's poor health condition could put his life at risk in jail.
Mr Aleman,57, ruled the Central American nation from 1997 to 2002. He was arrested in December last year.
He was held under house arrest until August this year, when the same judge ordered his transfer to prison.
Mr Aleman, alongside some members of his family and his former staff, is accused of helping to divert nearly $100m of state funds into his party's election campaign, among other corruption charges.
The case against him is part of an anti-corruption campaign by Nicaraguan President Enrique Bolanos.
In her ruling on Wednesday, Judge Mendez said Mr Aleman was suffering from high blood pressure, obesity and a heart condition, that could put his life at risk.
Earlier, court officials said the change was because of Mr Aleman's "chronic illnesses".
In February, he was rushed to a hospital with chest pains.
Under the new order, Mr Aleman will be able to move freely in the town of El Crucero, about 26 kilometres (18 miles) south of Managua.