By Mitra Taj

LIMA (Reuters) - A Peruvian prosecutor said Thursday that late Venezuelan President Hugo Chavez and two Brazilian construction companies may have bankrolled President Ollanta Humala's campaigns before he took office in 2011.

Prosecutor German Juarez has been investigating first lady Nadine Heredia, the co-founder and current president of Humala's party, for her possible involvement in undeclared campaign contributions. He asked a judge to bar her from leaving Peru.

Humala has presidential immunity against investigation until five years after the end of his term on July 28.

No charges have been filed. Roy Gates, Heredia's lawyer, said prosecutors had not identified any crimes linked to party finances to substantiate money-laundering suspicions.

Juarez said an informant gave prosecutors a letter addressed to Humala signed by Chavez that mentions some $2 million in "investments" in Humala's first presidential bid in 2006. The letter has not yet been examined for authentication.

"Burn any evidence, brother, for the good of us all. This is revolutionary, socialist aide," said the letter, as read by Juarez in a televised hearing.

If authentic, it would show the lengths Chavez went to spread his so-called Bolivarian revolution across Latin America.

Humala, a former radical military officer, once looked up to Chavez as a mentor. But in 2011, after losing the 2006 presidential election, Humala kept Chavez at a distance and won after campaigning in the more moderate style of Brazil's former President Luiz Inacio Lula da Silva.

Humala has denied taking money from Chavez. Humala's office did not immediately respond to requests for comment on Thursday. Heredia has said she has no intention of leaving Peru and is cooperating with investigators, whom she describes as under pressure from political foes.

Another informant alleged that construction companies Odebrecht SA [ODBES.UL] and Grupo OAS, both tangled in a vast corruption scandal in neighboring Brazil, gave Humala and Heredia hundreds of thousands of dollars and paid the salary of an adviser close to Brazil's Workers Party to help with Humala's 2011 campaign, Juarez said.

Odebrecht declined to comment and OAS did not immediately respond to requests for comment.

Odebrecht won a $5 billion natural gas pipeline contract during Humala's term after its sole competitor was disqualified from a public auction. The company has said the bidding process was fair.

Brazilian police said earlier this year they were investigating potential bribes from Odebrecht to Humala. Both Humala and Odebrecht denied any wrongdoing at the time.

(Reporting By Mitra Taj; additional Reporting By Marco Aquino)