Seoul: Impeached South Korean President Yoon Suk Yeol was released from detention on Saturday after a court overturned his arrest on procedural grounds. However, he remains under investigation for his controversial declaration of martial law.

Yoon, who was detained in a dawn raid in January on charges of insurrection related to his December 3 attempt to subvert civilian rule, walked out of the detention centre smiling. He then bowed deeply before a small crowd of cheering supporters.

"I bow my head in gratitude to the people of this nation," Yoon said in a statement released through his lawyers.

The court had cancelled his arrest warrant the previous day on technical and legal grounds, a decision that prosecutors, who are investigating Yoon, labelled as "unjust" in a statement on Saturday.

Yoon was freed after prosecutors waived their right to appeal the court’s verdict, which specifically concerned the technical details of his detention on criminal charges.

In addition to the criminal investigation, Yoon faces a separate ruling by the Constitutional Court on whether his impeachment will be upheld, with the court’s decision expected imminently.

Prosecutors stated that, "Given the Constitutional Court's ruling and related considerations, the Prosecutor General has instructed the team to actively present its arguments before the trial court instead," of appealing Yoon's release from detention.

If Yoon is removed from office, South Korea would be required to hold a fresh presidential election within 60 days.

The criminal case against Yoon will proceed even if he is formally stripped of office.

Yoon's legal team, which had previously filed a request to cancel his arrest on the grounds that the prosecution had delayed his indictment, hailed his release. "The president's release signifies the restoration of the rule of law," his lawyers said in a statement.

After his release, Yoon entered a convoy of vehicles and was driven directly to the presidential residence. AFP reporters saw him greet the hundreds of cheering supporters waiting outside the compound.

The opposition, however, condemned the court’s decision. Democratic Party leader Lee Jae-myung, addressing a rally, vowed to "fight until the insurrection is over."

Martial law

Yoon, a former prosecutor, caused turmoil in South Korea in December by briefly suspending civilian rule and deploying soldiers to parliament. He has been charged with insurrection for declaring martial law, which lawmakers quickly voted down before impeaching him.

The 64-year-old resisted arrest for two weeks, resulting in a tense standoff between his security team and investigators at his official residence in Seoul. He was finally taken into custody on January 15.

Much of the impeachment trial has focused on whether Yoon violated the constitution by declaring martial law, which is meant to be used only in times of national emergency or war. The opposition has accused him of invoking this extraordinary measure without proper justification.

Yoon’s lawyers have argued that the martial law declaration was necessary to alert the country to the dangers of "legislative dictatorship" by the opposition.