He is the first president to lose his job over the scandal in which Brazilian company admitted paying out millions.
Peru's embattled president announces resignation amid bribery allegations
Peru's President Pedro Pablo Kuczynski announced his resignation on Wednesday in an address to the nation, the day before he was to face an impeachment vote in Congress.
The 79-year-old former Wall Street banker, under fire over his links to Brazilian construction giant Odebrecht, denied allegations of bribe-taking but said his resignation was "the best thing for the country."
Mr Kuczynski is the first president to lose his job over the scandal in which the Brazilian company admitted paying out millions of dollars in bribes and gifts to Latin American politicians and businessmen to secure public works contracts.
His resignation comes a few weeks before Mr Kuczynski was due to host the Summit of the Americas in Lima, where US President Donald Trump and others leaders of the western hemisphere are expected on April 13-14.
"Faced with this difficult situation that unfairly makes me appear guilty, I think the best thing for the country is for me to resign the presidency of the republic," he said in the televised address, which showed him seated with his cabinet standing behind him.
"I do not want to be an obstacle, for the country to continue suffering with the uncertainty of these recent times," said the president, who survived a previous impeachment vote in December.
Vice President Martin Vizcarra, who is serving as Peru's ambassador to Canada, is likely to replace Mr Kuczynski to avoid early elections at a time of widespread voter discontent with political parties.
Pressure built on Mr Kuczynski to resign throughout on Wednesday after the opposition alleged the embattled president was trying to buy votes ahead of the impeachment ballot.
Lawmakers from Keiko Fujimori's Popular Force party released recordings of her brother Kenji and others apparently negotiating public works contracts with a government official, and said it was proof that Mr Kuczynski was trying to buy votes.
"This government thought it could buy everything. There will always be brave and worthy Peruvians who are not for sale. It's time to tell Mr PPK that he's leaving, and NOW!" Keiko Fujimori tweeted, using the president's initials.
The videos, dating from December, were filmed ahead of the previous impeachment vote, which Kuczynski survived with Kenji Fujimori's help.
Days later, Mr Kuczynski pardoned the Fujimoris' imprisoned father, former president Alberto Fujimori, in what was widely seen as a pay-off for support.
The government denied vote-buying.
Mr Kuczynski said during the week he was confident of defeating the impeachment vote.
On Sunday, Mr Kuczynski said removing him would amount to a "coup d'etat" in the South American country – and tarnish Peru's image just before it is due to host the Summit of the Americas.
Odebrecht has admitted spending millions to bribe government officials across Latin America to secure public works contracts.
Other politicians to lose their posts include Ecuador's former vice president Jorge Glas, who previously was the highest-ranking politician to fall over the Odebrecht scandal. He was jailed for six years.
The Supreme Court last week cleared the way for Peru to formally request the extradition of former president Alejandro Toledo from the US.
Mr Toledo, 71, is to face charges of accepting a staggering $20 million in bribes from Odebrecht.
Odebrecht said it paid five million dollars in fees to companies linked to Mr Kuczynski when he was Peru's economy minister, under Mr Toledo.
He was accused of lying about his ties to Odebrecht, but later admitted he had taken the money for what he and the company insist were legitimate consulting fees.
The scandal, which has dogged the president over the past six months, finally became too much for the elderly politician when it became increasingly clear he could not survive the impeachment vote.
"This political confrontation has created a climate of ungovernability which has done huge damage to the country and does not allow us to make progress," he said with regret in his voice during his address.
He leaves behind an economy that has performed well below expectations.
"We are seeing a complicated picture because the economy is feeling the impact of the political instability linked to the president," economist Jorge Gonzalez Izquierdo told AFP.