On Oct. 9, 1962, Uganda became independent, with Dr. Apollo Milton Obote, a Lango leader of the UPC, as prime minister. Buganda was given considerable autonomy. In 1963, Uganda became a republic, and Mutesa was elected president. The first years of independence were dominated by a struggle between the central government and Buganda. In 1966, Obote introduced a new constitution that ended Buganda's autonomy. The Baganda protested vigorously and seemed on the verge of taking up arms when Obote captured the kabaka 's palace at Mengo, forced the kabaka to flee the country, and ended effective Baganda resistance.

In 1967 a new constitution was introduced giving the central government—especially the president—much power and dividing Buganda into four districts; the traditional kingships were also abolished. In 1969, Obote decided to follow a leftist course in the hope of bridging the country's ethnic and regional differences through a common social policy.

Uganda has since gone through turbulent times. In Jan., 1971, Obote, at the time outside the country, was deposed in a coup by Maj. Gen. Idi Amin. He was to rule the country for the next eight years.

In 1978, Uganda invaded Tanzania in an attempt to annex the Kagera region. Tanzania launched a successful counter-invasion in 1979 and effectively unified different anti-Amin forces under the Uganda National Liberation Front (UNLF). Amin's forces were driven out and Amin himself fled the country.
Uganda was to have several Heads of State under UNLF: Prof. Yusufu Lule, Godfrey Binaisa, and Paul Muwanga as the Chairman of the Military Commission.