South Korea's Constitutional Court on Monday struck down the impeachment of Prime Minister Han Duck-soo.
The ruling means Han was immediately restored as acting president, a role he took over after President Yoon Suk Yeol was impeached by parliament for briefly declaring martial law in December.
Yoon's decree — which he said was needed to protect the country from the opposition Democratic Party's "anti-state" activities — sparked a massive political crisis in the country.
Prime Minister Han was appointed acting president after the opposition-controlled parliament voted to impeach Yoon.
But Han was himself impeached after less than two weeks in the role due to clashes with the opposition, who accused him of failing to block Yoon's martial law declaration.
He also fought with the opposition over his refusal to appoint three more justices to the Constitutional Court and for not supporting bills targeting Yoon and his wife Kim Keon Hee.
What has been the reaction to the court's ruling?
Following the ruling on Monday, Han thanked the court for its "wise decision."
"I believe that all citizens are clearly speaking out against the highly polarized political sphere. I think there is no place for division now. Our country's priority is to move forward," he said.
In a statement on Monday, the country's Presidential Office said the court's decision shows that parliament had abused its powers in issuing the unprecedented successive impeachments.
What is the latest with Yoon's case?
The Constitutional Court has yet to rule on Yoon's impeachment. If it is upheld, the country will have to elect a new president, but if it rules in Yoon's favor, he will be reinstated.
Yoon is also facing criminal charges of rebellion in relation to his martial law decree. He could face the death penalty or a life sentence if found guilty.
The martial law declaration deeply shocked the country, which was ruled by a succession of military dictatorships between the 1960s and 1980s.
The decree only lasted six hours after legislators descended on parliament to block the move, defying attempts by police and the military to keep them out of the building.
Yoon then resisted arrest for days, remaining inside the presidential compound as hundreds of his supporters clashed with police.