LIMA (Reuters) - Peru’s former left-leaning President Ollanta Humala, ordered to spend 18 months in pre-trial detention, was moved on Friday to a prison built for his longtime foe ex-autocratic leader Alberto Fujimori.

Peru's former president Ollanta Humala is escorted by police as he arrives at the Justice Palace to be held temporarily before being moved to a prison in Lima, Peru, July 13, 2017. REUTERS/El Comercio

Fujimori, 78, has spent the past decade as the lone inmate in Barbadillo prison, nestled in a police base on the outskirts of Lima, where he is serving a 25-year sentence for human rights crimes during his 1990-2000 rightwing government.

Humala, a former military officer whose five-year term ended a year ago, was transferred via police helicopter to Barbadillo where he will be held in custody until prosecutors conclude their money laundering investigation. Humala’s attorneys had sought better conditions for their client than Peru’s overcrowded jails.

A judge ruled on Thursday that Humala and wife Nadine Heredia must be jailed before an eventual trial to keep them from fleeing or obstructing a criminal probe linked to Brazilian builder Odebrecht. The couple has denied wrongdoing and had immediately turned themselves in, calling the measure an abuse of power.

Humala became a national figure when he commanded a group of soldiers to rebel against Fujimori’s government as it collapsed amid a graft scandal in 2000. He later rallied Fujimori’s opponents behind him to beat Fujimori’s daughter, Keiko, in the 2011 presidential election.

Still, Fujimori’s son, Congressman Kenji Fujimori, expressed solidarity with Humala and Heredia’s children. “I went through those tough times myself. Stay strong,” he said on Twitter.

Peru built Barbadillo for Fujimori before he was extradited from Chile in 2007. His cell includes a bedroom, office and access to a courtyard where he gardens, according to Peru’s National Penitentiary Institute (INPE).

Fujimori and Humala will not share common spaces, INPE said.

After Odebrecht admitted in December to paying $29 million in bribes to high-ranking officials in Peru over three presidencies, Peru’s justice minister said additional cells were being built at Barbadillo but did not specify for whom.

INPE director Carlos Vasquez said on local broadcaster RPP that Humala has special security needs as a former official, but that Barbadillo was not necessarily a prison for ex-presidents.

Former president Alejandro Toledo, another staunch opponent of Fujimori, has also been ordered to pre-trial detention in connection with an Odebrecht probe. Toledo has denied wrongdoing and has refused to turn himself in.

In an odd twist of fate, Fujimori might leave Barbadillo before Humala.

President Pedro Pablo Kuczynski, who endorsed Keiko Fujimori against Humala in 2011, last month proposed evaluating pardoning Fujimori for health reasons as he seeks better ties with Fujimori’s supporters in Congress.

In 2013, Humala rejected Fujimori’s request for a pardon.