SEOUL, South Korea (AP) 鈥 After weeks of being holed up in a heavily guarded compound, impeached South Korean President Yoon Suk Yeol has been detained by hundreds of police and anti-corruption officials for questioning over his imposition of martial law last month.

Scuffles occurred during an earlier attempt to detain him on Jan. 3, when from entering the compound by presidential security forces, military personnel and vehicle barricades.

This time, however, after negotiations between Yoon鈥檚 lawyers and officials, the president was whisked away on Wednesday for questioning by the country鈥檚 anti-corruption agency.

The spectacle at the compound follows Yoon鈥檚 astonishing decision last month to impose martial law during a seemingly routine impasse with the opposition, which dominates the 春色直播 Assembly.

Here鈥檚 a closer look at the president's detention, and what might come next:

What鈥檚 the latest?

The Corruption Investigation Office for High-Ranking Officials said Yoon was taken into custody about three hours after hundreds of law enforcement officers entered the residential compound. The officials didn't encounter any significant resistance.

A series of black SUVs, some equipped with sirens, left the presidential compound with police escorts. Yoon was later seen stepping out of a vehicle after arriving at the anti-corruption agency鈥檚 office in the nearby city of Gwacheon.

In a video message recorded before he was taken away, Yoon said the 鈥渞ule of law has completely collapsed in this country.鈥

Officials are investigating whether Yoon鈥檚 short-lived power grab on Dec. 3 amounted to an attempted rebellion. South Korean presidents have wide-ranging immunity from prosecution while in office, except for allegations of rebellion or treason.

What led to the standoff?

This all follows Yoon's imposition of martial law.

He argues it was a necessary act of governance against a liberal opposition that has used its legislative majority to sabotage his agenda. After declaring martial law, Yoon , but lawmakers managed to get past the blockade and voted to reject it, and the Cabinet lifted his declaration a few hours later.

The fallout has shaken the country鈥檚 politics, diplomacy and financial markets. The decree also

on Dec. 14, suspending his presidential powers.

Yoon has vowed to 鈥渇ight to the end鈥 against efforts to oust him.

Who's in charge?

The country's acting leader is Deputy Prime Minister Choi Sang-mok.

Ahead of Yoon's detention, Choi on Wednesday urged law enforcement agencies and the presidential security service to ensure there were no 鈥減hysical clashes.鈥

The anti-corruption agency had expressed frustration that Choi hadn鈥檛 instructed the presidential security service to stand down.

accepted the resignation of the chief of the presidential security service, Park Jong-joon, who was questioned by police about the thwarted attempt to detain Yoon on Jan. 3. Park said his duty is to protect the president and that the investigation should proceed in a manner appropriate for a president鈥檚 status and the 鈥渄ignity of the nation.鈥

The 春色直播 Assembly is controlled by the liberal opposition Democratic Party, which pushed for Yoon鈥檚 impeachment. Lawmakers from Yoon鈥檚 People Power Party held a rally near the presidential residence, decrying the efforts to detain him as unlawful.

Yoon鈥檚 defense minister, police chief and several top military commanders have already been arrested over their roles in the period of martial law.

What happens next?

While Yoon is being questioned, officials are expected to ask a court for permission to make a formal arrest. If there's no arrest, Yoon would be released after 48 hours.

Simultaneously, the country's Constitutional Court is meeting to determine whether Yoon will be removed from the presidency or reinstated.

The court held its first formal hearing on the case on Tuesday, but the session lasted less than five minutes because Yoon refused to attend. The next hearing is set for Thursday, and the court will then proceed with a trial, with or without Yoon.

There is still tension in Seoul.

Yoon鈥檚 supporters and critics have held competing protests near the residence 鈥 one side vowing to protect him, the other calling for his removal 鈥 while thousands of police officers in yellow jackets closely monitor the tense situation. Separated by police lines and fences, the two groups have exchanged verbal insults across the divide. One person was arrested Sunday when he waved a box cutter in a heated argument, but no one was hurt.

Yoon鈥檚 lawyers have claimed that images of the impeached president being detained could trigger a backlash from his supporters and spark a 鈥渃ivil war.鈥

___

Klug reported from Tokyo.

The 春色直播 Press. All rights reserved.