The Second Republic of Uganda existed from 1971 to 1979, when Uganda was ruled by Idi Amin's military dictatorship. Amin's rule formally came to an end with the Uganda-Tanzania War, which ended with Tanzania occupying Uganda and Amin fleeing into exile.

The Ugandan economy was devastated by Idi Amin's policies, including the expulsion of Asians, the nationalisation of businesses and industry, and the expansion of the public sector. The real value of salaries and wages collapsed by 90% in less than a decade. The number of people killed as a result of his regime is unknown; estimates from international observers and human rights groups range from 100,000 to 500,000.

Taking power From Uganda's independence from Great Britain in 1962 to early 1971, Milton Obote's regime had terrorized, harassed, and tortured people. Frequent food shortages led to food prices experiencing hyper-inflation, with one contributing factor being Obote's persecution of Indian traders. During Obote's regime, flagrant and widespread corruption had emerged. The regime was disliked, particularly in Buganda where people had suffered the most.

By January 1971, Milton Obote, then President of Uganda, was prepared to rid himself of the potential threat posed by Idi Amin. Departing for the 1971 Commonwealth Heads of Government Meeting at Singapore, he relayed orders to loyal Langi officers that Amin and his supporters in the army were to be arrested. Various versions emerged of the way this news was leaked to Amin. Also, the role of the foreign powers in the coup had been debated after the fact. Documents declassified by the British Foreign Office reveal that, contrary to earlier speculations, it was not directly facilitated by Great Britain but benefited from covert support by Israel which saw Idi Amin as an agent to de-stabilise Islamic Sudan. The documents however, unveil an outrightly positive assessment of Amin's personality by the British authorities as well as recommendations of support and the sale of arms to the new regime.

In any case, Amin decided to forestall Obote and strike first. In the early morning hours of 25 January 1971, mechanized army units loyal to him attacked strategic targets in Kampala and the airport at Entebbe, where the first shell fired by a pro-Amin tank commander killed two Roman Catholic priests in the airport waiting room. Amin's troops easily overcame the disorganized opposition to the coup, and Amin almost immediately initiated mass executions of Acholi and Langi troops, whom he believed to be pro-Obote.

The Amin coup was warmly welcomed by most of the people of the Buganda kingdom, which Obote had attempted to dismantle. They seemed willing to forget that their new president, Idi Amin, had been the tool of that military suppression. Amin stated intentions about his government's intent to play a mere "caretaker role" until the country could recover sufficiently for civilian rule. Amin repudiated Obote's non-aligned foreign policy, and his government was quickly recognized by Israel, Britain, and the United States. By contrast, presidents Julius Nyerere of Tanzania, Kenneth Kaunda of Zambia, Jomo Kenyatta of Kenya, and the Organization of African Unity (OAU) initially refused to accept the legitimacy of the new military government. Nyerere, in particular, opposed Amin's regime, and he offered hospitality to the exiled Obote, facilitating his attempts to raise a force and return to power.

Once in power

Amin's military experience, which was virtually his only experience, determined the character of his rule. He renamed Government House "the Command Post", instituted an advisory defence council composed of military commanders, placed military tribunals above the system of civil law, appointed soldiers to top government posts and parastatal agencies, and even informed the newly inducted civilian cabinet ministers that they would be subject to military discipline.

Uganda then became a military dictatorship which was, in effect, governed from a collection of military barracks scattered across the country, where battalion commanders, acting like local warlords, represented the coercive arm of the government. The Ugandan General Service Unit (GSU), an intelligence agency created by the previous government, was disbanded and replaced by the Ugandan State Research Bureau (SRB). SRB headquarters at Nakasero became the scene of torture and executions over the next couple of years.

Martin Ewans, the chief of the British Foreign Office's East Africa Desk wrote in 1977 that Amin's rule reflected his background in the King's African Rifles, writing: "All this, however, is qualified by Amin's training as a British 'other rank'. As the British army says, ‘if you see something, whitewash it; if it moves, salute it’. To some extent, Amin rules Uganda like an army barracks. First, the whitewash. Kampala, for example, is-or was when I last saw it-a well-run city. The hedges are cut, the verges trimmed, the road signs painted. Amin himself dresses immaculately, if bizarrely. Appearances are important...Not only in good order, however, but also military discipline. Ministers obey instructions, the Commanding Officer gives and receives 'briefings'. Affairs are run from a 'command post'. Wrong-doers are, so to speak, put on a charge and shot for desertion; if you need some serious law-enforcement, you have a court martial. The concept of hierarchy prevails over that of persuasion or consultation." The British anthropologist Mark Leopold noted that Amin had served in the King's African Rifles during the Kenya Emergency in the 1950s, during which he and others had engaged in "unrestrained violence" against the Kenyans, and that much of Amin's leadership style reflected his formative years.

Despite its outward display of a military chain of command, Amin's government was arguably more consumed with rivalries, regional divisions, and ethnic politics than the Uganda People's Congress (UPC) coalition that it had replaced. The army itself was an arena of lethal competition, in which the losers were usually eliminated. Within the officer corps, those trained in Britain opposed those trained in Israel, and both stood against the untrained, who soon eliminated many of the army's most experienced officers. In 1966, well before the Amin era, northerners in the army had assaulted and harassed soldiers from the south. In 1971 and 1972, the Lugbara and Kakwa (Amin's ethnic group) from the West Nile were slaughtering northern Acholi and Langi, who were identified with Obote. Then the Kakwa fought the Lugbara. Amin came to rely on Nubians and on former Anyanya rebels from southern Sudan. Starting in March 1971, Amin embarked a policy of systematically disarming and massacring Acholi and Langi soldiers, whom he viewed as potentially disloyal to his regime. The pace of the purge was greatly increased following several mutinies in July 1971.

Amin recruited his followers from his own tribe, the Kakwas, along with Sudanese and Nubians. By 1977, these three groups formed 60% of the 22 top generals and 75% of the cabinet. Similarly, Muslims formed 80% and 87.5% of these groups even though they were only 5% of the population. This helps explain why Amin survived eight attempted coups. By 1972, the Ugandan Army was largely composed of men from the West Nile Province (Amin's home province), along with men from the provinces in the Congo and the Sudan that bordered the West Nile Province. The Ugandan army grew from 10,000 to over 25,000 by 1978. Amin's army was largely a mercenary force. Half the soldiers were Sudanese, 26% Congolese, only 24% were Ugandan, mostly Muslim and Kakwa. The new Ugandan Army formed by Amin was largely undisciplined and came to support themselves by looting and stealing, which gave the new Amin regime a narrow, but real base of support while alienating the rest of the Ugandan population.

On 7 August 1973, Idi Amin decreed Swahili was to be Uganda's official language. Twelve out of the twenty districts had chosen this, while the other eight wanted Luganda.Swahili State and Society: The Political Economy of an African Language, Ali Al'Amin Mazrui, page 75 The army, which had been progressively expanded under Obote, was further doubled and redoubled under Amin. Recruitment was largely, but not entirely, in the north. There were periodic purges, when various battalion commanders were viewed as potential problems or became real threats. Each purge provided new opportunities for promotions from the ranks. The commander of the Uganda Air Force, Smuts Guweddeko, had previously worked as a telephone operator; the unofficial executioner for the regime, Major Isaac Maliyamungu, had formerly been a nightwatch officer. By the mid-1970s, only the most trustworthy military units were allowed ammunition, although this prohibition did not prevent a series of mutinies and murders. An attempt by an American journalist, Nicholas Stroh, and his colleague, Robert Siedle, to investigate one of these barracks outbreaks in 1971 at the Simba battalion in Mbarara led to their disappearances and later their deaths. Several army officers who were suspected of having been involved in the murder of Stroh and Siedle were later appointed to high-ranking positions: Among these were Military Tribunal chairman Juma Butabika, chief technical officer of the airforce Captain Taban, Minister of Transport Juma Sabuni, and Minister for Provincial Administration Ali Fadhul.

Muammar Gaddafi and the Soviet Union During his eight years as Uganda's ruler, Amin never forgot the source of his power. He spent much of his time rewarding, promoting, and manipulating the officers and soldiers of the Ugandan army. Financing his ever-increasing military expenditures was a continuing concern. Early in 1972, he reversed foreign policy — never a major issue for Amin — to secure financial and military aid from Muammar Gaddafi of Libya. Amin expelled the remaining Israeli advisers, to whom he was much indebted, and became anti-Israel. To induce foreign aid from Saudi Arabia, he rediscovered his previously neglected Islamic heritage. Amin was very close to King Faisal of Saudi Arabia, who won his favor in 1972 by giving him a lavish private jet to travel in, which was considerably more luxurious than the private jet he had received from Israel the previous year. He also commissioned the construction of a great mosque on Kampala Hill in the capital city, but it was never completed during his rule because much of the money intended for it was embezzled. In 2008 Amin's dream of building one of Africa's largest mosques came true, and construction was finally completed more than 30 years after it initially began.

Following his foreign policy reversal in 1972, the Soviet Union became Amin's largest arms supplier.

East Germany helped to build Amin's secret police. During the Tanzanian invasion in 1979, East Germany attempted to remove evidence about its involvement.Gareth M. Winrow: The foreign policy of the GDR in Africa, p. 141

Expulsion of Asians and nationalisations

In August 1972, Amin gave most of Uganda's 80,000 Asians, most of whom were the descendants of indentured servants and other laborers from India, 90 days to leave the country, and seized their property, homes and businesses. At the time of the expulsion, there were approximately 80,000 individuals of South Asian descent in Uganda, of whom 23,000 had had their applications for citizenship both processed and accepted. Although the latter were ultimately exempted from the expulsion, many chose to leave voluntarily. The expulsion took place against a backdrop of Indophobia in Uganda, with Amin accusing a minority of the Asian population of disloyalty, non-integration and commercial malpractice, claims Indian leaders disputed. Amin defended the expulsion by arguing that he was giving Uganda back to the ethnic Ugandan.