Before several thousand jubilant Ugandans who filled a plaza still littered with the spent shell casings of his invasion, Yoweri Museveni became president today and declared that he represented a break from the country's bloody tradition of government-sponsored murder.

Bodies of soldiers of the undisciplined Ugandan Army that had long terrorized the country's civilians lay in shallow graves and on roadsides on the outskirts of Kampala, where they fell to the guerrilla forces of Museveni, a former high school teacher who fled to the bush five years ago to fight what he called an "evil" regime.

With a legacy of two decades of government-condoned looting and rape and an estimated half million countrymen killed by armies of a series of dictatorships, residents of Kampala were saying today that they were both grateful and amazed at the disciplined behavior of Museveni's forces.

The 41-year-old guerrilla leader, who says he modeled his fighting techniques after those of Cuba's Fidel Castro, said in his inaugural speech that "nobody should state that what is happening today, what has been happening in the last few days, is a mere change of guards."

"I think this is a fundamental change in the politics of our country," he said.

But other than promising to guarantee human rights and to quash the tribal and religious rivalries that have been a source of much of Uganda's violent history, Museveni's speech contained few details about what kind of government he will create. He promised a return to parliamentary democracy, but gave no timetable for elections, and he has not yet appointed new government ministers.

Dressed in the freshly pressed fatigues of an Army private, with spit-shined boots and a green cap, Museveni spent most of his speech explaining how his government would protect the lives and property of civilians.

"No regime has the right to kill any citizen of Uganda. No regime has got a right to beat a citizen of Uganda," Museveni said. "As for the killing, this is absolutely out. You soldiers kill a citizen, we kill you. Any individual, any group or persons who threaten the security of our people should be smashed without mercy. The people should die only from natural causes beyond our control, but not from fellow human beings."

It is estimated that in the past 20 years, under the regimes of presidents Idi Amin and Milton Obote, about half a million Ugandans were killed, most of them by soldiers and security officials. In that time, most of the country's public works were destroyed.

Museveni's National Resistance Army (NRA) guerrillas routed soldiers of the deposed military government and of four allied fighting forces, many of whom had engaged in robbing, raping and killing in Kampala.

The NRA now claims to control two-thirds of this Oregon-sized country, and was moving today to round up soldiers who have fled to the north.

Last weekend's coup was the second in six months, and the sixth in the 24-year history of the country. The deposed military government, which was led by two generals from northern Uganda, had toppled Obote last July.

The two generals -- Tito Okello and Basilio Olara Okello, who are not related -- are believed to have fled north.

It has been a violent week in Kampala. This morning, beside Queens Way, a main road leading into town, the glassy-eyed body of a government soldier lay with feet bound together, the back of the head crushed in.

An NRA commander who was seeing to the disposition of the body said the solider was killed last night in the continuing mopping up of "bandits, of people with guns."

There are shallow graves on the outskirts of town for many of the bodies of the 200 soldiers who relief officials estimate were killed in fighting last Friday and Saturday.

The graves are marked with the black boots that were standard issue to soldiers of the deposed government. In a country where many people have no shoes, no one has stolen the boots. The NRA is still looking for anyone who wears them.

Western diplomats here who witnessed the government's retreat from Kampala said its soldiers grew increasingly ill-behaved as their defeat became imminent.

Former soldiers of Amin's army, who had allied with the military government, were looting and robbing civilians on Friday, the diplomats said.

That day, they said, the government sent soldiers to force a civilian manager of Uganda's telephone company to cut the country's phone lines. When the manager said he didn't know how to do it, the soldiers cut his throat, diplomats said.

Compared to last July's coup, there was little looting of shops. Most downtown stores appeared untouched by the fighting.

"While the amount of small-arms and artillery fire was considerable, the amount of damage to the city is surprisingly small," said Robert Hoedek, the U.S. ambassador here. "The amount of looting was small, and the vast majority was carried out by civilians."

"Israel Mayengo, a lawyer and businessman, said, "There is an absolute difference between the soldiers who went out three days ago and the ones who came in. Before, they were soldiers and they were beasts. Now they are soldiers and human beings, too."

Besides being well-behaved, many of the NRA forces who fought their way into Kampala last weekend were very young. At today's ceremony, there were scores of soldier-children, the youngest of whom held up 10 fingers when asked his age.

They carried large automatic weapons and dressed in patchwork uniforms, some wearing sneakers, some bright red pants, some with hats of the defeated army.

Guarded by his soldiers and cheered by war-weary residents of Kampala, Museveni appeared relaxed and seemed to enjoy his 50-minute speech. He spoke without notes in an informal, almost chatty manner, joking frequently.

Museveni spent much of his speech making fun of leaders who use their position to glorify themselves, even as they impoverish their people.

"There is this excellency who is going to the United Nations with the jets and so on while he has got 90 percent of his people walking on bare feet," Museveni said, to widespread applause and laughter.

He said that at a local level many decisions in his government would be made by elected "village committees." These committees, he said, would screen all new members of the police and Army and would check to ensure that "so and so's son is not a rogue, that he doesn't steal a chicken of the village, that he does not abuse people, that he does not stone passers-by."

On economic policy, Museveni has written that he would confine his government to "the crucial sectors and let private enterprise deal with the rest." Diplomats predict Uganda will maintain its prowestern political stance.

Museveni explained why he refused to implement a much-publicized peace agreement he signed Dec. 17 in Nairobi that would have made him an equal partner with the military government.

"I was sitting there with criminals across the table," Museveni said, referring to the two generals. "I was being advised . . . to be diplomatic. I thought it was a farce."

Museveni said "there were so many pressures" on him to sign. "The international community does not care about how many skeletons we have in Uganda. What they care about is trade," he said, in a veiled criticism of Kenya and Tanzania, which rely on Uganda's markets and its food exports, as well as on its roads for access to central Africa.