A South Korean court has extended the detention of impeached President Yoon Suk Yeol over concerns he could destroy evidence linked to his martial law declaration, enraging his supporters who attacked the court building.
Hundreds of pro-Yoon protesters smashed windows and broke down doors to enter the court after the decision was announced, chanting the name of the president, who plunged South Korea into its worst political chaos in decades with his bid to suspend civilian rule.
Reporters saw hundreds of police entering the building, with one officer from Seoul's Mapo district separately telling AFP that it was an "unfolding" situation.
The president's 3 December martial law declaration lasted just six hours, with politicians voting it down despite him ordering soldiers to storm parliament to stop them.
He was impeached soon after and suspended from duties.
Mr Yoon was detained in a dawn raid Wednesday on insurrection charges after he refused investigators' summons and went to ground in his residence, using his presidential security detail to resist arrest.
The Seoul Western District Court said in a statement that it had issued a formal arrest warrant extending his detention as "there is a concern that the suspect may destroy evidence".
South Korea's first sitting president to be detained, Mr Yoon had also refused to cooperate during the initial 48 hours detectives were allowed to hold him.
The leader, who attended court for the first time over his case, will now remain in custody, with the new warrant allowing investigators to keep him for up to 20 days.
His lawyer Seok Dong-hyeon slammed the court decision, but also warned the president's supporters not to escalate the situation.
"This is likely not what President Yoon desires," he said in a statement, adding violence could also "create burdens" for the president's future trials.
Some protesters smashed their way into the building, one using what looked like a riot shield taken from police, and vandalised the interior, while others outside sprayed an apparent fire extinguisher at the police.
The outer tiles, walls and windows of the court building were damaged, AFP reporters saw.
Protesters chanted: "President Yoon Suk Yeol, we protect."
'Passionate patriotism'
Earlier, tens of thousands of Mr Yoon protesters had gathered outside the court.
Scuffles resulted in some 40 people detained, police said, while two official vehicles belonging to the body probing Yoon were also attacked.
Mr Yoon sent a letter through lawyers thanking his supporters, who include evangelical Christians and right-wing YouTubers, for protests that he deemed "passionate patriotism".
During the hearing, some protesters outside waved South Korean and American flags and cried "Impeachment is invalid!".
His party typically favours South Korea's US security alliance and rejects engagement with the nuclear-armed North.
"Yoon has urged maximum mobilisation among his hardline supporters," Chae Jin-won of Humanitas College at Kyung Hee University said.
With the president now likely to be detained for an extended period, the final protest serves "as a sort of farewell event between Yoon and his extreme support base".
The crisis has seemingly boosted support for the conservative People Power Party (PPP), for whom Yoon won the presidential election in 2022.
A Gallup survey published showed the PPP's approval rose to 39%, three points higher than the opposition Democratic Party.
The decision to approve Mr Yoon's continued detention gives prosecutors time to formalise a criminal indictment for insurrection, a charge for which he could be jailed for life or executed if found guilty.
Such an indictment would also mean he would likely be detained for a maximum six months during the trial.
Mr Yoon said he had agreed to leave his compound to avoid "bloodshed" but that he did not accept the legality of the investigation.
He has refused to answer investigators' questions, with his legal team saying he explained his position the day he was arrested.
Mr Yoon has also been absent from a parallel probe at the Constitutional Court, which is considering whether to uphold his impeachment.
If that court rules against him, Mr Yoon will formally lose the presidency and elections will be called within 60 days.
He did not attend the first two hearings this week but the trial, which could last months, will continue in his absence.
The hearing at Seoul Western District Court lasted nearly five hours. Mr Yoon spoke for about 40 minutes during the hearing, Yonhap said, citing Mr Yoon's lawyer.
"(Yoon) sincerely explained and answered questions on factual relationships, evidence and legal principles ... We will quietly wait for the court to decide," said Mr Yoon's lawyer, Yoon Kab-keun, after the hearing.
Mr Yoon had decided to attend the hearing "to restore his honour by directly explaining the legitimacy of emergency martial law and that insurrection is not established", his lawyer said earlier.
TV channels showed a convoy of around a dozen cars and police motorbikes escorting Mr Yoon from the detention centre to the court, as well as back to the detention centre.
Since police broke up a crowd of Mr Yoon's supporters blocking the court gate in the morning, thousands of supporters surrounded the court after the hearing began at around 2pm local time behind a police barricade chanting "release the president".
"There are so many supporters of President Yoon Suk Yeol around the court, who still believe in the rule of law and are defending the president," said Lee Se-ban, a 30-year-old man.
Multiple people were arrested by police for trying to break into the court grounds, including a young man who tried to escape, according to a Reuters witness.
Insurrection, the crime alleged against Mr Yoon by the Corruption Investigation Office for High-ranking Officials, is one of the few that an incumbent South Korean president does not have immunity from.