The world's last Hindu kingdom became its newest secular republic as Nepal's lawmakers, led by former communist insurgents, abolished the monarchy that had reigned over this Himalayan land for 239 years. Ahead of the vote Wednesday, thousands of people marched, danced and sang in the streets of Katmandu in anticipation of the result, waving red hammer-and-sickle flags as dour King Gyanendra awaited his fate in the pink concrete palace that dominates the city's center. He finally found out the fate of his throne late in the day when, as expected, the newly elected Constituent Assembly declared the country a republic and abolished the monarchy by a vote of 560-4. The assembly's 37 other members were not present. "We have entered a new era today," said Prime Minister Girija Prasad Koirala, calling Nepal's rebirth as a republic "the dream of the whole nation." There was no immediate reaction from the 61-year-old king, who has remained silent in recent months as it became apparent that his days on the throne were numbered. He now has 15 days to quit the 1970s-era palace and move to his large private residence in the city - or face the possibility of being removed by force. As word of the republic's declaration spread through Katmandu, groups of celebrating young men yelled in the streets and set off firecrackers. "The people in Nepal have defeated the autocrat Gyanendra," said Gopal Thapa, a 23-year-old supporter of the Maoists, the former rebels. "Nepal is now the people's republic." All around him, a crowd celebrating outside the convention center, where the vote was held, chanted "Long live the republic!" and denounced Gyanendra as a thief. Not since the Shah of Iran was deposed in the bloody 1979 Islamic revolution has one of the world's monarchs been forced from his throne. But while the end of Nepal's royal dynasty may have come in a peaceful vote, the stage for the monarchy's demise was set by a communist insurgency that bled Nepal for a decade, and a 2001 palace massacre in which a gunman, allegedly the crown prince, assassinated King Birendra and much of the royal family before killing himself. Gyanendra then assumed the throne. But the killings helped pierce the mystique surrounding a line of kings who had once been revered as reincarnations of the Hindu god Vishnu, and Gyanendra was dogged by rumors that he was somehow involved in the massacre. His 2005 seizure of power from a civilian government only made matters worse. He said he needed total authority to crush the Maoists, but he quickly began locking up peaceful opponents and found himself beset by an intensifying insurgency and a faltering economy. A year later, weeks of massive protests forced Gyanendra to restore democracy, after which the Maoists came out of the bush and began peace talks. An interim government, meanwhile, slowly stripped away the trappings of a kingdom. Gyanendra lost command of the army, his portrait was replaced by Mount Everest on the currency, the word "royal" removed from the name of the national airline, and references to the king dropped from the national anthem. Gyanendra, who is believed to be personally wealthy with interests in tourism, tea and tobacco, also endured other indignities. His US$3.1 million annual allowance was taken away, as were the queen's beauticians and about half his ceremonial guard. Then came April's vote for the assembly in which the fiercely republican Maoists won the most seats, all but sealing the fate of the dynasty, which dates to 1769 when a regional ruler conquered Katmandu and united Nepal. With the king now gone, Nepalis are settling in for a three-day public holiday. But what comes next remains uncertain. While the Maoists say they are committed capitalists and have no intention of nationalizing industries or setting up collective farms, they have promised to bring sweeping change to this largely impoverished country. But they are struggling to form a government. Wednesday's opening assembly session was delayed for hours while they wrangled with other political parties over who should be president and what powers he should have. At the end of the day, they still had no deal. It may be difficult to fashion lasting peace in Nepal, where supporters of every major political party have been linked to killings since the start of the peace process. The Maoists still have 20,000 fighters in UN-monitored camps spread across the country and their former fighters were recently implicated in the abduction and murder of a Katmandu businessman. In New York, UN Secretary-General Ban Ki-moon congratulated Nepal's 27 million people on the assembly's first meeting and urged lawmakers "to form a new government as soon as possible," said UN deputy spokeswoman Marie Okabe.