LIMA, Peru — President Pedro Pablo Kuczynski survived a bid by Congress on Thursday to remove him from office over allegations linking him to a graft scandal that has rattled Latin America, as lawmakers fell short of the necessary two-thirds majority after 12 hours of impassioned debate.

Mr. Kuczynski, who took office in July 2016, delivered an emotional plea to Congress earlier in the day, calling the claims against him “weak” and saying the impeachment proceedings were being used for political gain.

“Congress members, do not join this strategy, do not let yourselves become confused,” Mr. Kuczynski, 79, said. “Those who accuse me will not let their condemnation be subjected to corroboration, to a debate, to due process.”

His detractors called the president “permanently morally unfit” to lead the country, arguing that he committed perjury in a congressional inquiry by stating that he had no professional ties to the Brazilian construction giant Odebrecht. It was later revealed that a financial services company he owned had received $782,000 from Odebrecht, which is now at the center of the graft scandal.