(above) After more than 11 hours of debate, Peru's President Kuczynski survived a vote. Photograph: Mariana Bazo/Reuters

Peru president Pedro Pablo Kuczynski survives bid to impeach him

Vote comes after it emerged Kuczynski hid ties with Odebrecht, the Brazilian construction firm facing corruption allegations in 12 countries

Dan Collyns in Lima

Peru's president Pedro Pablo Kuczynski has escaped being pushed out of office by the narrowest of margins after legislators failed to reach the two-thirds of the vote needed to oust him on the grounds of "moral unfitness".

The vote followed the revelation that a company Kuczynski owned had business ties with the Brazilian construction firm Odebrecht, which has been at the centre of Latin America's biggest corruption scandal.

Peru moves to impeach scandal-hit president Pedro Pablo Kuczynski

After more than 11 hours of debate, the 79-year-old leader won a reprieve when the opposition fell short by just eight votes of the 87-out-of-130 needed to force him out. Negotiations went on until the final hours of the session and some legislators were persuaded to change their vote, parliamentary sources told The Guardian.

The mood of political instability was heightened by Kuczynski's suggestion in a televised address to the nation on Wednesday night that his two vice presidents would resign if Congress removed him, prompting new elections. This factor likely influenced the final vote in the chamber, say analysts.

Kuczynski is the latest high-ranking politician to be consumed in the unfolding Odebrecht scandal, a vast web of political and corporate corruption which began in Brazil. In a 2016 plea bargain with the US justice department, Odebrecht admitted paying some $800m in bribes in 12 mostly Latin American countries, including some $29m in Peru between 2009 and 2015.

Before the debate, Kuczynski addressed the chamber telling lawmakers: "I am here to look you in the eye and tell you that I am not corrupt and I have not lied." He asked the nation for forgiveness and admitted he had been careless but denied having accepted a bribe or a knowingly allowing a conflict of interest.

Kuczysnki, a former Wall Street Banker, said the real aim of the majority right-wing opposition group Fuerza Popular, which dominates Peru's congress, was to push through a hasty coup and revert the country to its authoritarian past. The party is led by Keiko Fujimori, the daughter of the former president Alberto Fujimori (1990-2000) who is in jail for authorising death squad killings, corruption and vote-rigging. She lost the 2016 to Kuczynski by a hair's breadth.

"What's at stake is not whether I remain in office: what's at stake is democratic stability," Kuczynski said. "Don't support this groundless removal ... the people will not forgive you."

Kuczynski was given just a week mount his defence after the impeachment proceeding were announced last Friday. He said his business partner managed his company Westfield Capital when he held public office more than a decade ago and he had no knowledge of its operations at the time.

The Fuerza Popular group, popularly known as the Fujimoristas, was joined by the hard-left Frente Amplio, a smaller party, in its call for the president to be removed.

But in end Kenji Fujimori, the youngest son of the former president led a group of nine lawmakers from his party in abstaining from the vote, allowing Kuczynski to continue in office and hinting at a sibling rivalry between him and his older sister Keiko, the party leader.

Kuczynski may have survived this vote, but Steven Levitsky, a political scientist at Harvard University and an expert on Peru, says "it would be a surprise to see him make it to the end of his term."

His only salvation would be "if the entire anti-Fujimorista coalition continues to be so terrified of the Fujimoristas getting into the executive that they keep him there as a bulwark," he told The Guardian.

"He's on very, very thin ice."

Kuczynski is not the only politician under investigation for links to the Odebrecht. Peru's prosecutors office is investigating Keiko Fujimori and her party over allegations of illegal donations from Odebrecht to her presidential campaigns in 2011 and 2016. Former president Alan Garcia (2006-11) is also under investigation.