After a quarter century of almost constant conflict, wanton killing and tyranny, Ugandans finally see peace on the horizon. The last remaining guerrillas are giving up the fight and pledging to help a fledgling government rebuild a nation that had become the killing field of Africa.

For 15 million Ugandans, the years of rule by dictators Idi Amin and Milton Obote are beginning to slip into an indelibly horrifying history of an estimated 800,000 people killed in bush wars or by whim since independence from Britain 26 years ago.The sun-parched bones of thousands upon thousands still lie - in informal memorial piles - in the fields where their bodies were dumped over the years by one faction or another.

Uganda's new dawn of peace seems clear in this capital, where people no longer fear the night.

Ghost-like and riddled with gunfire, death and rape until recently, Kampala's nights now are alive: People take the evening strolls so long denied them; restaurants are open and brightly lighted; discoteques throb until daybreak; shops and street markets are open late.

The city's half-million people now battle something else - traffic jams as more cars flow into the country.

"Peace in our time is breaking out all over the place," said U.S. Ambassador Robert Houdek.

Behind the new-found optimism is President Yoweri Museveni, leader of the National Resistance Army (NRA) that came in from the bush Jan. 27, 1986, to take over from a 12-member military council that ousted Obote, Amin's elected successor, seven months before.

Obote became prime minister after independence in 1962 only to be overthrown by Amin in 1971.

But Museveni faces a monumental task, even though the rebels are turning in their arms.

Once East Africa's richest nation, Uganda is staggering under nearly $2 billion in foreign debt, galloping inflation, widespread corruption and rampant black marketeering - all remnants of the economic turmoil spawned by Amin after he seized power in 1971.

But now that rebel insurgencies in the northern savannah country and the swampy east have eased, money can be freed for badly needed reconstruction and development, particularly in Kampala where buildings still bear the pock marks of bullets, others have fallen into disrepair from neglect and still others remain unfinished in the tumultuous years gone by.

The key to Uganda's new dawn is a peace treaty Museveni signed June 3 with the powerful Uganda People's Democratic Army (UPDA) guerrilla organization to end its 18-month-old northern offensive.

Rebel and government officials said the truce was reached after the UPDA, largely remnants of troops of Obote's post-Amin government, decided its aims were similar to those of the Museveni's NRA and dissociated themselves from exiled leaders in London who called for continued fighting.

The UPDA claimed to have 5,000 men in the north around Gulu, 175 miles north of Kampala. Museveni has promised that those rebels not guilty of atrocities can join his army or go home.

During Obote's second term, government forces waged a vicious counterinsurgency campaign against Museveni's guerrillas and killed hundreds of thousands of civilians as suspected rebel supporters.

Since seizing control, Museveni has brought members of numerous political parties and smaller guerrilla groups into his Cabinet and army. He is doing this in an effort to end the deep-rooted tribal and factional conflicts that have fractured the nation and left it in virtual ruins from the Obote-Amin-Obote years.

Government control also is being restored through the east and northeast where rebels loosely grouped as the Uganda People's Army (UPA) under Obote's defense minister, Peter Otai, are taking advantage of the amnesty Museveni offered last August. The government claims as many as 10,000 of the eastern insurgents have put down their arms.

Uganda's most recent uprisings broke out in late 1986 after government troops, mainly Bantu tribesmen and southerners, committed human rights abuses in the north, which is populated by Nilotic people, UPDA and government officials charge.

Both sides say the troops were among those incorporated into the NRA after Museveni took Kampala. Museveni integrated the offending units with his better-disciplined battalions, and more than a dozen NRA soldiers convicted of capital crimes have been executed.

Such punishment and his release in June of nearly 1,700 prisoners detained illegally without charge has eased the main concerns of human rights activists and other interested groups. Most of them laud Museveni's progress in restoring the human and civic rights lost.

"For the first time, as much as some individuals in the NRA have committed atrocities, they have minimized the number of people being killed in cold blood," Methodius Albriko Otto, a political officer with the UPDA, said in an interview.

The president also has created a commission to probe past human rights abuses and named a government inspector to investigate corruption and current human rights abuses.

"On the whole, this government has done a good job," said Livingstone Sewanyana, legal adviser to the Kampala-based Uganda Human Rights Activists Organization. "People have much more freedom to speak and move. This government is seriously committed to improve."

While pockets of UPA rebels continue to fight in the east, the main rebel threats are largely quelled and Museveni can turn his attention to gaining control of a ransacked economy.

At independence, Uganda had one of the strongest economies in sub-Saharan Africa - based largely on exports of coffee, cotton, copper and textiles. Its industry, although small, supplied basic consumer goods.

It had the best rail, road and power networks in the region as well as superior health and education systems. And its fertile soil and temperate climate enabled the landlocked nation, slightly smaller than Oregon, to feed itself.

But the warfare, corruption and mismanagement under Amin and Obote left Uganda an impoverished hulk.

Many of the country's best-trained personnel fled to escape Amin's bloody purges and the political and random murders that started soon after he came to power power in 1971. His impetuous expulsion of 45,000 Asian residents a year later depleted businesses and factories of their best managers.

Gross domestic product fell a fifth by the time Tanzanian soldiers backing Obote's return joined Ugandan rebels to send Amin into flight in 1979 - eventually to Saudi Arabia, where he is believed to still reside.

Corruption and continued fighting under Obote accelerated the economic tailspin.

When Museveni marched into Kampala in 1986, the nation was gutted. War-damaged buildings littered the countryside, roads were destroyed, factories had been idled and farms abandoned.

He inherited a thriving black market, widespread corruption, triple-digit inflation and a $1.82 billion foreign debt.

But without a single trained economist in his Cabinet, Museveni has been unable to find quick solutions.