Peru manager Ricardo Gareca has agreed to stay with the team through qualifying for the 2022 World Cup. Mark Brown/Getty Images

LIMA -- Argentine Ricardo Gareca has signed a new three-year contract to lead Peru's national team through qualifying for the 2022 World Cup in Qatar, he said on Wednesday.

Gareca, 60, has been celebrated as a national hero by many in Peru since leading the team back to the World Cup finals in 2018 for the first time since 1982.

The contract can be extended for an additional year if Peru qualify for the 2022 World Cup, said Gareca who took charge of the team in 2015.

Gareca's decision will likely come as relief to the Peruvian Football Federation (FPF), whose president, Edwin Oviedo, has been under pressure to resign over accusations he gave World Cup tickets to a judge who helped exclude him from a murder probe.

Last week, the FPF's sports director warned that the scandal surrounding Oviedo, who denies wrongdoing, could derail Peru's bid to persuade Gareca to renew his contract.

But Gareca appeared to defend Oviedo.

"It seems like today society judges anyone freely and with no problem," Gareca told a news conference. "I don't like to judge people. That's what the justice system is for."

Oviedo is one of several people, including local businessmen and lawmakers, who have appeared in wiretapped phone conversations published by local media in which judges appear to be using their positions to secure favours.

In the recordings, Supreme Court Judge Cesar Hinostroza appears to be arranging to receive tickets for the World Cup from Oviedo.

Hinostroza, who is now under investigation for influence peddling, was one of five judges who signed off on a ruling that excluded Oviedo from a murder probe in 2016.

Public prosecutors suspected Oviedo of leading a criminal gang that killed workers of his former sugar company. Oviedo has denied involvement.

Gareca, who played 20 times for Argentina, said he only wanted to focus on football.

"The situation is complicated. Well, we also have to work under these circumstances," he said.

Peru had one win and two losses at this year's World Cup in Russia, failing to get past the group stage.