(UPDATE) SEOUL — South Korea's impeached President Yoon Suk Yeol was formally arrested early on Sunday, days after being apprehended in Seoul.He faces possible imprisonment over his ill-fated declaration of martial law last month.Yoon's arrest could mark the beginning of an extended period in custody, lasting months or more.The decision to arrest Yoon triggered unrest at the Seoul Western District Court, where dozens of his supporters broke in and rioted, destroying the main door and windows.They used plastic chairs, metal beams and police shields that they managed to wrestle away from officers.Some were seen throwing objects and using fire extinguishers, destroying furniture and glass doors.They shouted demands to see the judge who had issued the warrant, but she had already left.Hundreds of police officers were deployed and nearly 90 protesters were arrested.8 hours deliberationFollowing eight hours of deliberation, the court granted law enforcement's request for an arrest warrant for Yoon, saying he was a threat to destroy evidence.Yoon and his lawyers on Saturday appeared before the court and argued for his release.While South Korean presidents have wide-ranging immunity from prosecution while in office, the protection does not extend to allegations of rebellion or treason.The Corruption Investigation Office for High-Ranking Officials, which is leading a joint investigation with police and the mili-tary, can now extend Yoon's detention to 20 days, during which they will transfer the case to public prosecutors for indictment.Yoon's lawyers could also file a petition to challenge the court's arrest warrant.Yoon's appearance in court triggered chaotic scenes in nearby streets, where thousands of his fervent supporters rallied for hours calling for his release.Even before the court issued the warrant for Yoon's arrest, protesters repeatedly clashed with police who detained dozens of them, including about 20 who climbed over a fence in an attempt to approach the court.Yoon's lawyers said he spoke for about 40 minutes to the judge during the nearly five-hour closed-door hearing Saturday.His legal team and anti-corruption agencies presented opposing arguments about whether he should be held in custody.Yoon's defense minister, police chief and several top military commanders have already been arrested and indicted for their roles in the enforcement of martial law.Yoon's lawyer decries arrestThe crisis began when Yoon, in an attempt to break through legislative gridlock, imposed military rule and sent troops to the National Assembly and election offices.His political fate now lies with the Constitutional Court, which is deliberating whether to formally remove him from office or reinstate him.Seok Dong-hyeon, one of Yoon's lawyers, called the court's decision to issue the warrant 'the epitome of anti-constitutionalism and anti-rule of law,' maintaining Yoon's claim that his martial law decree was a legitimate act of governance.Yoon's People Power Party regretted his arrest but also pleaded for his supporters to refrain from further violence.The liberal opposition Democratic Party, which drove the legislative effort to impeach Yoon on Dec. 14, said his arrest would be a 'cornerstone for restoring the collapsed constitutional order.'The country's acting leader, Deputy Prime Minister Choi Sang-mok, expressed 'strong regret' about the violence at the court, saying it 'directly undermines democracy and the rule of law.'He asked for heightened security at the sites related to Yoon's case and measures to ensure order during protests.After its investigators were attacked by protesters later on Saturday, the anti-corruption agency asked media companies to ob-scure the faces of its members attending the hearing.Martial law decree legitimateYoon and his lawyers have claimed that the martial law declaration was intended as a temporary and 'peaceful' warning to the liberal opposition which he accuses of obstructing his agenda with its legislative majority.Yoon has stressed he had no intention of stopping the functioning of the legislature. He stated that the troops were sent there to maintain order, not prevent lawmakers from entering and voting to lift martial law.He denied allegations that he ordered the arrests of key politicians and election officials.If prosecutors indict Yoon on rebellion and abuse of power charges, which are the allegations now being examined by inves-tigators, they could keep him in custody for up to six months before.