Slideshow ( 2 images )

LIMA (Reuters) - Peruvian prosecutors asked a judge late on Wednesday to bar outgoing President Pedro Pablo Kuczynski from leaving the country, hours after he resigned in the face of near-certain impeachment, a judiciary source told Reuters.

Prosecutors want to ensure Kuczynski is in Peru while they investigate payments his consulting firm received from Brazilian builder Odebrecht while he held senior government posts more than a decade ago, said the source, who spoke on condition of anonymity.

Kuczynski has denied wrongdoing but announced his resignation earlier on Wednesday after a fresh scandal over alleged vote-buying destroyed his chances of defeating a vote to force him from office.

Kuczynski will have presidential immunity from prosecution until Congress formally accepts his resignation, likely on Friday, according to the president of Congress.