South Korea’s impeached president will appear at a hearing in a Seoul court on Saturday to oppose a formal arrest over last month’s imposition of martial law, his lawyers said.

Yoon Suk Yeol, who has been in detention since he was apprehended on Wednesday in a massive law enforcement operation at his residence, faces potential rebellion charges linked to his declaration of martial law on December 3, which set off the country’s most serious political crisis since its democratisation 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

Police officers stand guard outside of the detention centre where President Yoon Suk Yeol is being held in Uiwang (Lee Jin-man/AP)

The president is expected to argue that there is no need for him to be in custody during an investigation at the hearing on Saturday afternoon. The judge is anticipated to make a decision by late Saturday or early Sunday.

Hundreds of Mr Yoon’s supporters rallied overnight at the court, calling for his release.

If he 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, Mr Yoon will be released and return to his residence.

The crisis began when Mr 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 December 14.