LIMA (Reuters) - A Peruvian appeals court ruled on Friday that 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.

FILE PHOTO: Peru's former President Ollanta Humala and former first lady Nadine Heredia leave the Nationalist Party headquarters in Lima, Peru, July 13, 2017. REUTERS/Guadalupe Pardo/File Photo

Humala, who was president a little over a year ago, and former first lady Nadine Heredia have been accused of taking illegal campaign donations from Brazilian builder Odebrecht SA [ODBES.UL] in 2011 and from late Venezuelan President Hugo Chavez in 2006 and using them for personal enrichment.

The couple has denied the accusations and said a lower court’s July 13 ruling ordering them to be jailed while public prosecutors finish a money laundering probe violates due process.

“We’re clearly taking this to the Supreme Court,” Defense Attorney Wilfredo Pedraza told reporters, calling the measure “disproportionate.”

A corruption scandal involving Odebrecht in Brazil has spread through the region.

Odebrecht’s former executive Marcelo Odebrecht has testified that the company gave $3 million to Humala on orders from Brazil’s former leader Luiz Inacio Lula da Silva’s Workers Party, Prosecutor German Juarez has said.

Rightwing opposition leader Keiko Fujimori and centrist President Pedro Pablo Kuczynski have denied that their parties took money from Odebrecht.

Attorney General Pablo Sanchez has denied any political bias.

The finances of the Peruvian Nationalist Party that Humala and Heredia co-founded in 2005 have been probed for years.

Humala is in the same prison as former president Alberto Fujimori, who is serving a 25-year sentence for human rights crimes and graft.

Centrist ex-president 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.