Parliament in Nepal has voted to abolish the monarchy, as part of a peace deal with former Maoist rebels.
Gyanendra has only months left as king
The Maoists left the government in September, vowing not to return unless the monarchy was scrapped. They ended a decade-long insurgency last year.
Nepal will be declared a republic after elections in April next year.
King Gyanendra, whose dynasty dates back to 1769, lost popular support when he sacked the government in 2005 and assumed absolute power.
The decision to make Nepal a "federal democratic republican state" was taken by an overwhelming majority - 270 MPs out of 371 voted to abolish the monarchy, with only three against.
The main political parties had originally agreed to leave the question of whether Nepal should become a republic to the constituent assembly being elected in April.
But the Maoists wanted the decision taken at once - hence the agreement reached by the main political parties earlier this week. It will allow the Maoists to re-join the administration.
However, it will be the new assembly which formally abolishes the monarchy, leaving Gyanendra as king in name at least until then - unless he tries to disrupt the process, in which case parliament has given itself powers to dismiss him at once.
"Today's vote has made sure the king will be removed immediately after elections," said home minister Krishna Prasad Situala.
Corruption and insurgency
The king's fall from grace began in February 2005, when he dismissed parliament and took executive powers for himself, saying this was the way to root out corruption and end the Maoist insurgency of the day.
But his heavy-handed action united political opposition to him, and a violent uprising in April last year forced him to restore parliament.
The new civil authorities have since stripped him of his powers, his command over the army, his immunity from prosecution - and now are set to strip him of his title.