South Korean President Yoon Suk Yeol survived an impeachment vote in the opposition-led parliament on Saturday that was prompted by his short-lived attempt to impose martial law this week, after members of his party boycotted the session.
Only 195 votes were cast, below the 200 needed for the vote to count, and the motion was scrapped.
"The entire nation is watching the decision being made here at the National Assembly today. The world is watching," said Speaker Woo Won-shik, adding that it was unfortunate that not enough lawmakers participated for the votes to be tallied.
The main opposition Democratic Party vowed to try again, while Yoon's party said it would find a "more orderly, responsible" way to resolve the crisis.
Yoon shocked the nation late on Tuesday when he gave the military sweeping emergency powers to root out what he called "anti-state forces" and overcome obstructionist political opponents.
He rescinded the order six hours later after parliament defied military and police cordons to vote unanimously against his decree.
But the move plunged Asia's fourth-largest economy and key US military ally into its greatest political crisis in decades, threatening to shatter South Korea's reputation as a democratic success story.
The opposition needed at least eight votes from Yoon's conservative People Power Party to reach the two-thirds majority needed to impeach. As PPP lawmakers departed after casting votes on a separate motion, some people shouted and cursed them. Only three from Yoon's party voted.
The president apologised to the nation on Saturday morning but resisted calls to resign ahead of the vote.
His party said it could not allow a repeat of the 2016 impeachment of then-President Park Geun-hye, who left office after months of candle-lit protests over an influence-peddling scandal.
Her downfall triggered the implosion of the party and a victory by liberals in presidential and general elections.
"We cannot repeat the tragedy of paralysis of state affairs and suspension of constitutional government through the impeachment of the president," PPP spokesperson Shin Dong-uk said after the failed vote, noting that Yoon had apologised and vowed to leave his future up to the party.
In scenes reminiscent of the protests against Park, thousands of demonstrators holding candles flooded the streets outside parliament on Friday and Saturday nights, demanding Yoon's impeachment.
Protester Choi Yong-Ho, 60, said he was furious at the prospect that the impeachment bill would not succeed, but vowed to keep coming to future protests.
“We have to make our voices heard,” he said.
Saturday's televised speech was the embattled Yoon's first public appearance since he rescinded the martial law order.
"I leave it up to my party to take steps to stabilise the political situation in the future, including the issue of my term in office," he said in the address to the nation, promising there would be no second attempt to impose martial law.
Standing in front of the South Korean flag, Yoon bowed after finishing his brief remarks, staring solemnly into the camera for a moment.
Han Dong-hoon, leader of Yoon's party, said after the address that the president was no longer in a position to carry out his public duties and his resignation was now unavoidable.
On Friday Han said Yoon was a danger to the country and needed to be removed from power, increasing the pressure on Yoon to quit.
In the end, however, most PPP members closed ranks and boycotted the vote. One member who participated said he had voted against impeachment, though he said he did not believe Yoon was suitable for the office.
If Yoon leaves office before his single five-year term ends in May 2027, the constitution requires a presidential election within 60 days upon his departure.
Martial law has been declared more than a dozen times since South Korea was established as a republic in 1948, the last time in 1980.
In Tuesday's declaration, Yoon gave the military sweeping emergency powers to combat unspecified threats from "North Korean communist forces" and "to eradicate the shameless pro-North anti-state forces".
He went on to accuse the National Assembly of launching an unprecedented number of impeachment efforts against members of his administration, effectively paralysing key operations, and of handling the budget in a way that undermined the fundamental functions of the government, including public safety.
The martial law declaration sent shockwaves around the world and drew rare criticism from senior American officials who had previously praised Yoon as a champion of democracy in Asia.