A special assembly in Nepal has voted to abolish the Himalayan kingdom's 239-year-old monarchy.
King Gyanendra will have a fortnight to vacate his royal palace in Kathmandu before it is turned into a national museum.
The move meets a key demand of former Maoist rebels who have been fighting a bitter insurgency against the regime since the mid-1990s.
Led by former rebel leader Pushpa Kamal Dahal, the Maoists' Communist Party emerged as the largest in elections to the country's 601-member assembly last month.
Thousands of Nepalese marched, danced and sung in the capital's streets to celebrate 'the dawn of the republic' hours before a special assembly elected in April was to hold its first meeting to declare the republic.
Many hope it will be the final chapter of a peace process ending a decade-long war that killed more than 13,000 people.
'Let's celebrate the dawn of a republic in a grand manner,' one loudspeaker blared from the top of a taxi.
Thousands of Nepalese gathered in the historic parts of Kathmandu and near the site of the assembly, ringed by riot police.
Demonstrators chanted 'Long live the republic!' and sung songs deriding the king.
Security is tight in the capital after a series of bomb blasts, some blamed on pro-royalist groups, over the past few days. No one was killed in the explosions.
Unpopular King Gyanendra is expected to vacate his pink pagoda-roofed palace in the capital Kathmandu soon after the vote.
He has made few comments on his future plans, except to say he wanted to remain in Nepal.
The government has given him a fortnight to leave the palace but warned he could be forced out if he refuses.
Decline and fall
It has been a dramatic decline and fall for a king once waited upon by thousands of retainers. Many Nepalese revered the monarch in majority-Hindu Nepal as an incarnation of Lord Vishnu, the god of protection.
Now, his portrait has been wiped off bank notes and his name has disappeared from the national anthem. He has been asked to pay his own electricity bills.
'The king will be given 15 days to leave the palace and the palace will be turned into a historical museum after he leaves,' Peace and Reconstruction Minister Ram Chandra Poudel said.
The assembly motion on the change to a republic is expected to be approved.
Although some royalists may oppose the move, they are heavily outnumbered by mainstream political groups and the Maoist former rebels.
Nepalese say much of the mystique of the royal family was destroyed by the 2001 palace massacre in which popular King Birendra and eight other royals were killed by then Crown Prince Dipendra, who then turned a gun on himself.
The royal image was further tarnished after King Gyanendra fired the government and assumed absolute powers in 2005 only to be humbled by weeks of anti-king protests a year later.
Political parties and Maoists say a new president will step into the king's place as a head of state after the end of the monarchy.
The head of the UN mission warned yesterday that Nepal still faces many challenges, including political violence and a Maoist army of thousands which has yet to be fully demobilised.
'The Constituent Assembly election was a milestone, a major achievement, in that (peace) process, but it does not represent the completion of the process,' Ian Martin told reporters.
But ordinary citizens in the streets of Kathmandu are happy to focus on the present.
'I think it is good that the king is going,' said taxi driver Niranjan Shrestha.
'He hasn't done anything for the people except amassing money for himself and his family.'