Nepal's supreme court on Friday blocked the government's attempt to impeach the chief justice, a move that had prompted concerns the ruling coalition was seeking to undermine judicial independence.
The government filed a motion to impeach the country's first female chief justice Sushila Karki country's
last Sunday after the two main parties in the coalition accused her of political interference.
The move came just days after Karki overturned the government's choice for chief of police.
The order issued by the top court said that the government's move went against "the spirit of the constitution".
Supreme court spokesman Bishwaraj Paudel told AFP that Karki would resume her duties from Sunday.
The UN human rights chief harshly criticised Nepal's efforts to impeach Karki, whose supporters say has taken a strong stance against corruption during her year-long tenure as head of the supreme court.
"I urge the Nepal authorities to respect the independence of the judiciary (and) to withdraw what appears to be a politically motivated impeachment motion," United Nations rights chief Zeid Ra'ad Al Hussein said in a statement.
Zeid pointed out that Karki had been "instrumental in a number of high-profile and politically sensitive decisions," and warned that "the attempt to remove her gives rise to serious concerns about the government's commitment to transitional justice and the rule of law."
Nepal emerged from a brutal decade-long Maoist insurgency in 2006, which brought the end of the country's 240-year-old Hindu monarchy.
But Nepal's transformation to a federal state has been marred by political infighting and successive governments have dragged their feet on bringing perpetrators of abuses committed during the civil war to justice. 
On Karki's watch, a lower court last month sentenced three soldiers to 20 years in jail for the murder of a teenage girl during the war, only the second conviction for crimes committed during the conflict.