SEOUL, South Korea (AP) — South Korea’s impeached president, Yoon Suk Yeol, was formally arrested early Sunday, days after being apprehended at his presidential compound in Seoul, as 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 for him, lasting months or more.

The Seoul Western District Court granted law enforcement’s request for an arrest warrant on Yoon following an hourslong deliberation, saying he was a threat to destroy evidence. Yoon and his lawyers on Saturday appeared before the court’s judge during a hearing and argued for his release.

Yoon, who has been in detention since he was apprehended on Wednesday in a massive law enforcement operation at his residential compound, faces potential rebellion charges linked to his declaration of martial law on Dec. 3, which set off the country's most serious political crisis since its democratization in the late 1980s.

The Corruption Investigation Office for High-Ranking Officials, which is leading a joint investigation with police and the military, can now extend his 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.

THIS IS A BREAKING NEWS UPDATE. AP’s earlier story follows below.

SEOUL, South Korea (AP) — South Korea’s impeached president on Saturday argued for his release before a Seoul judge as the court reviewed whether to grant a law enforcement request for his formal arrest.

His appearance at the Seoul Western District Court triggered chaotic scenes in nearby streets, where thousands of his fervent supporters rallied for hours calling for his release. They clashed with police, who detained around 40 protesters including about 20 who climbed over a fence in an attempt to approach the court. At least two vehicles carrying anti-corruption investigators were damaged as they left the court after arguing for Yoon’s arrest.

Yoon has been in detention since he was apprehended on Wednesday in a massive law enforcement operation at his residence. He faces potential rebellion charges linked to his declaration of martial law on Dec. 3, which set off the country's most serious political crisis since its democratization in the late 1980s.

The Corruption Investigation Office for High-Ranking Officials, which is leading a joint investigation with police and the military, requested the Seoul Western District Court to grant a warrant for Yoon’s formal arrest.

Yoon’s lawyers said he spoke for about 40 minutes to the judge during the nearly five-hour closed-door hearing. His legal team and anti-corruption agencies presented opposing arguments about whether he should be held in custody. The lawyers did not share his specific comments.

The judge is expected to make a decision by late Saturday or early Sunday. Yoon’s motorcade was seen leaving the court Saturday evening for the detention center, where Yoon will await the decision.

If Yoon is arrested, investigators can extend his detention to 20 days, during which they will transfer the case to public prosecutors for indictment. If the court rejects the investigators’ request, Yoon will be released and return to his residence.

Chaotic scenes outside the court

Yoon was transported to the court from a detention center in Uiwang, near Seoul, in a blue Justice Ministry van escorted by police and the presidential security service.

The motorcade entered the court’s basement parking space as thousands of Yoon’s supporters gathered in nearby streets despite a heavy police presence. Some protesters broke through the police lines and tapped on the windows of his van approaching the court. Yoon did not speak to reporters.

After its investigators were attacked by protesters, the anti-corruption agency asked media companies to obscure the faces of its members attending the hearing.

It hadn't been clear until Saturday morning whether Yoon would choose to attend the hearing.

Yoon insists his martial law decree was legitimate

Defense lawyers met Yoon at the detention center and he accepted his legal team's advice to appear personally before the judge, said Yoon Kab-keun, one of the president’s lawyers. The lawyer said the president was to argue that his decree was a legitimate exercise of his powers and that accusations of rebellion would not hold up before a criminal court or the Constitutional Court, which is reviewing whether to formally remove him from office or reinstate him.

Nine people, including 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.

The 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. The standoff lasted only hours after lawmakers who managed to get through a blockade voted to lift the measure. The opposition-dominated assembly voted to impeach him on Dec. 14.

If Yoon is formally arrested, it could mark the beginning of an extended period in custody for him, lasting months or more.

If prosecutors indict Yoon on rebellion and abuse of power charges, which are the allegations now being examined by investigators, they could keep him in custody for up to six months before trial.

Under South Korean law, orchestrating a rebellion is punishable by life imprisonment or the death penalty.

Yoon’s lawyers have argued that there is no need to detain him during the investigation, saying he doesn’t pose a threat to flee or destroy evidence.

Investigators respond that Yoon ignored several requests to appear for questioning, and that the presidential security service blocked an attempt to detain him on Jan. 3. His defiance has raised concerns about whether he would comply with criminal court proceedings if he's not under arrest.

Police officers stand guard as supporters of impeached South Korean President Yoon Suk Yeol try to enter the Seoul Western District Court in Seoul, South Korea, Saturday, Jan. 18, 2025. (AP Photo/Ahn Young-joon)

Credit: AP

icon to expand image

Credit: AP

A vehicle carrying impeached South Korean President Yoon Suk Yeol leaves the Seoul Western District Court in Seoul, South Korea, Saturday, Jan. 18, 2025. (AP Photo/Ahn Young-joon)

Credit: AP

icon to expand image

Credit: AP

Police officers stand in front of supporters of impeached South Korean President Yoon Suk Yeol after they illegally climbed over a fence inside the Seoul Western District Court in Seoul, South Korea, Saturday, Jan. 18, 2025. (AP Photo/Ahn Young-joon)

Credit: AP

icon to expand image

Credit: AP

Supporters of impeached South Korean President Yoon Suk Yeol stage a rally to oppose his impeachment in Seoul, South Korea, Saturday, Jan. 18, 2025. (AP Photo/Lee Jin-man)

Credit: AP

icon to expand image

Credit: AP

A supporter of impeached South Korean President Yoon Suk Yeol attends a rally to oppose his impeachment outside the Seoul Western District Court in Seoul, South Korea, Saturday, Jan. 18, 2025. (AP Photo/Ahn Young-joon)

Credit: AP

icon to expand image

Credit: AP

Supporters of impeached South Korean President Yoon Suk Yeol stage a rally to oppose his impeachment outside the Seoul Western District Court in Seoul, South Korea, Saturday, Jan. 18, 2025. (AP Photo/Ahn Young-joon)

Credit: AP

icon to expand image

Credit: AP

A supporter of impeached South Korean President Yoon Suk Yeol lies down on the ground during a rally to oppose his impeachment outside the Seoul Western District Court in Seoul, South Korea, Saturday, Jan. 18, 2025. (AP Photo/Ahn Young-joon)

Credit: AP

icon to expand image

Credit: AP

Seok Dong-hyeon, one of the lawyers for South Korea's impeached President Yoon Suk Yeol, speaks to the media upon his arrival at the Seoul Western District Court in Seoul, South Korea, Saturday, Jan. 18, 2025. (AP Photo/Ahn Young-joon)

Credit: AP

icon to expand image

Credit: AP

Supporters of impeached South Korean President Yoon Suk Yeol gather outside the Seoul Western District Court in Seoul, South Korea, Saturday, Jan. 18, 2025. (Seo Dae-yeon/Yonhap via AP)

Credit: AP

icon to expand image

Credit: AP

A vehicle carrying impeached South Korean President Yoon Suk Yeol arrives at the Seoul Western District Court in Seoul, South Korea, Saturday, Jan. 18, 2025. (Kim Min-Hee/Pool Photo via AP)

Credit: AP

icon to expand image

Credit: AP

Police officers detain supporters of impeached South Korean President Yoon Suk Yeol after they illegally climbed over a fence inside the Seoul Western District Court in Seoul, South Korea, Saturday, Jan. 18, 2025. (AP Photo/Ahn Young-joon)

Credit: AP

icon to expand image

Credit: AP