President Yoon Suk Yeol faces an impeachment vote this Saturday after briefly imposing martial law in South Korea.
AFP looks at how the dramatic events of the past few days unfolded in a country where democracy had been assumed to be firmly anchored -- and what might happen next.
Yoon announced late Tuesday in an address to the nation that martial law was being imposed, for the first time in more than four decades.
The suspension of civilian rule was to protect the country from "threats posed by North Korea's communist forces and to eliminate anti-state elements plundering people's freedom and happiness," Yoon said.
Then a six-point decree from army chief General Park An-su, installed as martial law commander, banned political activities and parties, "false propaganda", strikes and "gatherings that incite social unrest".
Security forces sealed the National Assembly, helicopters landed on the roof and soldiers tried to lock down the building, seemingly to prevent lawmakers from getting inside.
But as parliamentary staffers blocked the soldiers with sofas and fire extinguishers, enough MPs -- some leaping over barriers -- got inside to vote down Yoon's move.
This brought cheers from the thousands of protesters braving bitter temperatures outside, many waving national flags and chanting for Yoon to be arrested.
Several tense hours followed before Yoon appeared on television again at around 4:30 am (1930 GMT Tuesday) to rescind martial law.
On Wednesday six opposition parties filed an impeachment motion, which will go before parliament on Saturday at around 7:00 pm (1000 GMT).
If it passes, Yoon will be suspended pending a verdict by the Constitutional Court which has to rule within 180 days. In the meantime the prime minister would be acting president.
If the president is impeached, a new presidential election must be held within 60 days.
An opposition block hold 192 seats in the 300-member parliament, so the motion needs only eight defections from the president's People Power Party (PPP) for the necessary two-thirds majority.
However on Thursday the head of the PPP said that while he had demanded Yoon leave the party over his "unconstitutional martial law", he would block the impeachment motion.
"All 108 lawmakers of the People Power Party will stay united to reject the president's impeachment," party floor leader Choo Kyung-ho said.
But whether they all toe the line -- in particular 18 PPP lawmakers who voted against martial law -- remains to be seen.
Even if Yoon -- who has gone to ground since the early hours of Wednesday -- avoids impeachment, the 63-year-old could still face legal problems.
Police are investigating him for "insurrection", a crime which is not covered by presidential immunity and can carry the death penalty.
Police are also probing Interior Minister Lee Sang-min and Kim Yong-hyun, the defence minister whose resignation was accepted today and who is now barred from leaving the country.
Lawmakers have been grilling senior figures, including army chief of staff General Park, who acted as Yoon's martial law commander and who says he was not informed beforehand.
Yoon has lurched from scandal to scandal including over a deadly Halloween crush in 2022 and his wife accepting a designer handbag.
His mother-in-law was sentenced to one year in prison for forging financial documents in a real estate deal. She was released in May 2024.
More recently the opposition slashed Yoon's budget. He complained that "all key budgets essential to the nation's core functions" were being cut.