LIMA, April 19 (CGTN) -- A Peruvian judge on Friday ordered former president Pedro Pablo Kuczynski to spend up to three years in jail while prosecutors prepare corruption charges against him for allegedly taking bribes from Brazilian construction company Odebrecht.

The decision comes just two days after another former Peruvian president, Alan Garcia, committed suicide as police arrived at his door to arrest him in connection with alleged bribes from Odebrecht.

Before his suicide, Garcia had repeatedly brushed off allegations of corruption as a political hit.

Kuczynski, an 80-year-old former Wall Street banker who once held U.S. citizenship, denies wrongdoing. Kuczynski did not attend the hearing before Judge Jorge Chavez on Friday because he was receiving treatment for heart problems in a local clinic.

After Garcia killed himself on Wednesday, Kuczynski's attorney asked prosecutor Jose Domingo Perez to consider putting Kuczynski under house arrest instead of pre-trial detention as planned. But Perez said Kuczynski's health problems could be treated without problem in jail, and Judge Chavez approved his request to hold Kuczynski in jail for 36 months before trial.

The ruling came as Garcia was being buried and will likely further fuel criticism that the Odebrecht probe has become too aggressive and that prosecutors and judges were abusing the use of so-called "preventive prison," or pre-trial detention.

Under Peruvian law, criminal suspects can be held in jail before trial for up to three years if prosecutors show evidence that they would likely be convicted and would probably try to flee or obstruct the investigation unless detained.

Peru's four most recent presidents and the leader of the opposition have been ordered to pre-trial detention in connection with Odebrecht since the company admitted in late 2016 that it paid some 30 million dollars in bribes to Peruvian politicians, part of a sophisticated bribery system its former executives detailed to authorities abroad.

Prosecutors in the Odebrecht probe say they need preventive prison to keep wealthy and powerful suspects from evading justice as they gather evidence in the country's biggest graft investigation.

But critics, including the chief justice of Peru's Constitutional Tribunal, Ernesto Blume, say it is being used excessively in response to anger at widespread corruption.

Kuczynski, who was president a little over a year ago, has said he has cooperated fully with investigators, even declining to file an appeal when they barred him from leaving the country shortly after resigning in March of 2018.

As president, Kuczynski initially denied having any link to Odebrecht. But he eventually acknowledged his consulting company advised Odebrecht on financing for projects that it had won while he was a cabinet minister in the government of former President Alejandro Toledo.