KATHMANDU, Nepal - Nepal stood on the brink yesterday of becoming the world's newest republic as an assembly charged with ending 239 years of royal rule was sworn in amid tight security.

But with the world's last Hindu king still in the pink-hued, 1970s-era palace that dominates central Kathmandu, political leaders were threatening to remove him by force.

"He has no choice, but if he refuses to leave the palace, we will use the law to force him out of there," Baburam Bhattarai, deputy leader of the Maoists, Nepal's former rebels, said of King Gyanendra.

Getting rid of the king is in many ways the least of the new government's problems, as evidenced by four bombings in Kathmandu the last two days, apparently aimed at pro-republic politicians and activists.

While the bombings wounded two people, they also underscored how difficult it will be to fashion lasting peace and bring widespread prosperity to this Himalayan land that was bled for a decade by the Maoist insurgency and that is still regularly bloodied by political violence.

Yesterday's swearing-in of 575 lawmakers - 26 more are to be appointed later - marked a major step in the peace process that ended the insurgency and the culmination of the Maoists' transformation from a rebel army into a political force.

The Maoists won the most seats in April's election for the assembly and have promised to bring sweeping change to largely impoverished Nepal.

First up when the assembly gets to work today is doing away with the Shah dynasty. It dates from 1769, when a regional ruler conquered Kathmandu and united Nepal.

Once the republic "is declared," Bhattarai said, "the king will automatically lose his position and place in the palace."

After that, the Maoists have declared a three-day holiday. But once the celebrations end, no one is certain what will happen with the Maoists still struggling to form a government, and political violence still persistent.

The chief of the U.N. mission in Nepal, Ian Martin, warned that the violence threatened the peace process and he criticized Nepal's politicians for doing little to stop it.

Politically motivated killings have been committed by virtually every major political group since the Maoists gave up their fight two years ago, and Martin said he hoped for "a new commitment to justice and law and order from all political parties."

Even in victory, the Maoists worry many in Nepal. They still have 20,000 fighters in U.N.-monitored camps across the country, and their former fighters were recently implicated in the abduction and slaying of a businessman.

Ahead of today's declaration of a republic, the Maoists' youth wing - a group accused of intimidating, roughing up and killing opponents - was bringing 20,000 of its people to Kathmandu to "make sure the celebration does not get out of hand," said Sagar, the group's leader in the capital.

Authorities deployed 10,000 police around the city yesterday, a day after banning protests near the convention center and palace.

But the bombings and heavy security did little to dampen the spirits of ordinary Nepalis, many of whom eagerly awaited the assembly's first session today.

"We are Nepal now," said Ram Shrestha, 26, a store clerk. "It is no longer the king's country."

Hours after the swearing-in, King Gyanendra and Queen Komal drove out of the palace in their Mercedes on a "personal excursion" but were expected back later in the evening, a palace official said. He would not say where they were going.