A Peruvian appeals court has ruled that the former President Ollanta Humala and his wife must remain in pre-trial detention for up to 18 months while they are investigated for campaign contributions.
Humala led Peru from 2011 to 2016.
Both he and his wife, Nadine Heredia, are accused of receiving money from the Brazilian construction firm Odebrecht, the Peruvian firm OAS and the Venezuelan government.
The couple has denied the accusations and said a lower court's July 13 ruling ordering them to be jailed while public prosecutors finish the probe violates due process.
"We're clearly taking this to the Supreme Court," Defense Attorney Wilfredo Pedraza told reporters, calling the measure "disproportionate."
Last month, Judge Richard Concepcion Carhuancho ruled that there was a "high probability" that they would try to evade justice.
The judge ruled preventative detention was "appropriate and necessary."
The finances of the Peruvian Nationalist Party which Humala and Heredia co-founded in 2005 have been probed for years.
Humala is in the same prison as the former president Alberto Fujimori, who is serving a 25-year sentence for human rights crimes and graft.
While another of the country's ex-leaders, Alejandro Toledo, has also been ordered to pre-trial detention in connection with the Odebrecht investigation.
Peru is trying to extradite Toledo from the United States.