KIEV (Reuters) - Ukrainian opposition figure Mikheil Saakashvili was freed from detention on Monday, after a Ukrainian judge turned down the prosecutors’ request to place him under house arrest - the latest twist in his dramatic standoff with the authorities.

Ukrainian opposition figure and Georgian former President Mikheil Saakashvili (L) waves to supporters after he was released from detention in Kiev, Ukraine December 11, 2017. REUTERS/Gleb Garanich

President of his native Georgia for nine years until 2013, Saakashvili moved to Ukraine after a popular uprising there and served under Poroshenko as a regional governor from 2015-2016, before falling out with the Ukrainian leader.

The 49-year-old accuses the Ukrainian authorities of widespread corruption. Prosecutors wanted him placed under house arrest while investigators look into accusations he assisted a criminal organization, charges he says were trumped up to undermine his campaign to unseat Poroshenko.

“The prosecutors’ petition ... is dismissed,” Judge Larysa Tsokol told the court.

A crowd of several hundred supporters, who had remained outside the courthouse throughout the eight-hour hearing, cheered the judge’s decision.

“The judge is good. She did everything correctly and in accordance with the law,” Saakashvili said. “It means not everything is lost in Ukraine.”

The case against him remains open.

Slideshow ( 6 images )

Speaking after the ruling, which was attended by several prominent opposition lawmakers, including former prime minister Yulia Tymoshenko, Saakashvili said he planned to continue his political work.

Together with other opposition politicians he will “prepare for a peaceful but very important and necessary change in leadership in Ukraine”, he said.

Saakashvili, who launched a hunger strike to protest against his detention, sang the Ukrainian national anthem at the beginning of the hearing.

The courtroom was so packed with journalists and Saakashvili’s supporters that his lawyer asked the judge to move the session to a larger room.

The investigation provoked violent clashes between protesters and riot police last week, while on Sunday several thousand people attended a peaceful rally in central Kiev to support Saakashvili and call for Poroshenko’s impeachment.

“While the protest does not represent a significant risk to government stability at the moment, it will likely attract the attention of Ukraine’s international supporters and donors,” London-based research firm Teneo Intelligence said in a note.

Saakashvili is also facing the threat of possible extradition to Georgia, where he is wanted on criminal charges.

Justice Minister Pavlo Petrenko told Reuters the extradition request was being considered but no final decision had yet been made. He denied the case was politically motivated.

“Every person who lives in Ukraine must respect the basic laws,” he said.

“Unfortunately so far we only see things that are unworthy behavior of such a person.”