Judge Richard Concepcion's ruling late Friday also states that the ex-president cannot change addresses and must post a $15,000 bail.
Prosecutors fear that Humala -- whose five year presidency ended in July -- might flee the country as the case winds through the courts.
Humala and his wife Nadine Heredia are accused of laundering some $1.5 million allegedly sent from Brazil and Venezuela to help fund his 2006 and 2011 presidential campaigns.
The hearing on Friday lasted 10 hours. Humala, who was not in the courtroom, denies all charges.
More From This Section
If found guilty he and his wife could face between eight and ten years prison.
Prosecutors believe the Venezuelan funds came directly from the government of then-president Hugo Chavez, and the Brazilian money from two large construction firms, the Odebrecht Group and Construtora OAS.
Both Brazilian companies became ensnared in pay-to-play cases during the government of leftist then-president Luiz Inacio Lula da Silva.
Odebrecht CEO Marcelo Odebrecht was arrested in 2015 on corruption charges, while Construtora OAS filed for bankruptcy amid a corruption investigation.