NAIROBI, Kenya (AP) _ Tribal warfare and political upheaval over the past 20 years has made Uganda, once called ''the pearl of Africa,'' a symbol of chaos and widespread savagery.

Estimates of the number of Ugandans killed since dictator Idi Amin took power in 1971 range as high as 800,000.

A former British colony, Uganda became independent on Oct. 9, 1962, when then Prime Minister Milton Obote received the official documents from the Duke of Kent while Amin, then an army colonel, hauled down the Union Jack and ran up the Ugandan flag.

Four years later, Amin helped Obote wrest power from Sir Frederick Mutesa, Uganda's first post-independence president, by leading an attack on the palace. Mutesa fled to England, where he died three years later.

Obote became president and dissolved the British-drafted constitution that had given the Baganda tribe governing power.

Upon assuming full power in 1967, Obote proclaimed Uganda a republic, abolished the four traditional tribal kingdoms and replaced them with a central administration.

In January 1971, Amin seized power while Obote was attending a meeting of Commonwealth leaders in Singapore.

Amin, a member of the small Kakwa tribe, was initially hailed for ending the rule of Obote, who had persecuted the Baganda. But Amin soon embarked on a campaign of tyranny that left an estimated 300,000 Ugandans dead, many of them murdered by his troops.

On April 11, 1979, Ugandan rebels and exiles backed by soldiers from neighboring Tanzania overthrew Amin, who fled the country and now lives in Saudi Arabia.

After three short-lived governments crumbled, Obote regained power in a December 1980 election that his opponents claimed was rigged.

Confronted with a guerrilla insurgency that began in 1981, Obote relied on his armed forces, which were widely accused of massacres and other human rights abuses.

The army - dominated by members of the Acholi tribe and Obote's Langi tribe - began to break up along tribal lines early this year, and the infighting culminated in the July 27 coup which ousted Obote.

The officers who took power pledged to halt the nationwide violence, but atrocities by soldiers continued and so did the insurgency by the National Resistance Army.

The peace treaty signed with the NRA today was hailed as the start of a ''new era of peace'' for Uganda, but Gen. Tito Okello, the head of state, said in his speech at the signing ceremony that ''reconciliation and forgiveness will not come easily.''