Foreign support played an important role for Uganda during the Uganda–Tanzania War of 1978–1979. Before this conflict, the Second Republic of Uganda under President Idi Amin had generally strained international relations. Accordingly, only a few states as well as non-state allies provided Uganda with substantial military support during the war, most importantly Libya under Muammar Gaddafi and the Palestine Liberation Organization. The intervention of these two parties was regarded as crucial for Amin's ability to stay in power during the later stages of the war, even though they did not prevent Uganda's eventual defeat. However, there were many claims about other states and groups in Africa, the Arab world, Europe, and Asia covertly supplying Amin with materiel, soldiers, and money, although most of these remain unverifiable.

Background In course of his rule from 1971 to 1979, Amin's international alignments and alliances repeatedly shifted. He proved to be opportunistic, discarding allies when they were no longer useful. This helped him to stay in power and prevented outside powers from exerting too much influence on Uganda. On the other side, Amin earned a reputation as unpredictable, aggressive, and unreliable strongman. In the years before the Uganda–Tanzania War, he had forged particularly close connections with Libya under Muammar Gaddafi, the Palestine Liberation Organisation (PLO), and the Eastern Bloc. However, his relations with the Soviet Union and its allies worsened in 1978, resulting in a reduction in foreign aid before the Uganda–Tanzania War's outbreak. In addition, Uganda was placed under economic sanctions by the United States in response to the poor human rights record of Amin's government. This greatly weakened his position and further damaged Uganda's already-struggling economy.

Confirmed support by states Libya Background and early involvement

Libya was Uganda's closest ally at the time of Uganda–Tanzania War. The former had invested financially and politically into Uganda, with Libyan businesses having partially taken over the position of Ugandan Asians who were expelled in 1972. In addition, Gaddafi regarded Uganda as an important base for the Libyan-allied PLO, and as an ally in his rivalry with Egypt and Sudan. Libya "normally" had about 300 to 400 soldiers stationed in Uganda before the 1978–79 war. In 1977, Gaddafi had publicly declared that "whoever declares war on President Amin declares it on Libya".

Shortly before the Ugandan invasion of Kagera, Amin asked Gaddafi to intervene and resolve the "potentially explosive" tensions between Uganda and Tanzania, claiming that Tanzanian forces were moving within 4.8 km (3 mi) of Ugandan border towns. He also requested military support, and Gaddafi reportedly promised Amin to send soldiers. After the Uganda–Tanzania War's outbreak, Libya supported a solution through negotiations. Libya offered to mediate between the two countries in November 1978, and the Ugandan government responded positively to the proposal, but Tanzanian officials dismissed a mediation by Libya. The Observer reported that Libyan troops and arms were being sent to aid Amin as early as 12 November 1978. Journalist Faustin Mugabe stated that Libyan soldiers were being covertly sent to Uganda by December. After the Tanzanians retook the Kagera Salient during Operation Chakaza, they claimed to have captured some Libyan radio technicians serving alongside the Uganda Army.

Libyan intervention force Another Libyan mediation attempt in February 1979 failed to bring about any resolution. As a peaceful solution proved unfeasible, Libya began to fully support Amin's government with troops and equipment. According to political scientist René Lemarchand, after the failure of mediation attempts Gaddafi "seems to have found himself obliged to make good on his earlier boasts". Gaddafi felt that Uganda—a Muslim state in his view—was being threatened by a Christian army, and wished to halt the Tanzanians. He reportedly decided to initiate a military intervention without consulting other Libyan officials and over the objections of his army commander, Major Farak Suleiman. In mid-February, Libyan troops were flown into Entebbe to assist the Uganda Army, though in early March the Libyan government denied that its forces were being sent to Uganda.

Over the course of the war a total of 4,500 Libyan troops were deployed in the country. The intervention force included regular units of the Libyan Armed Forces, sections of the People's Militia, and members of the Pan-African Legion. Most of these troops were relatively untrained; few were professionals. Major Suleiman complained that the regular army units were needed at home to guard the border to Egypt; accordingly, the intervention force had to do with second-rate forces. The members of the People's Militia were not even informed that they were being sent into combat. Some of the militiamen were told that they were flown to Tobruk for a celebration parade. Others were made to believe that they would only participate in joint-training exercises with Ugandan troops or were supposed to take part in military exercises in southern Libya. There were also rumours about Libyans being threatened into participating in the intervention force. Most of the militiamen were relatively old. The Pan-African Legion was mostly recruited from Sub-Saharan Africans, mercenaries, and Libyan penal soldiers. The latter were usually criminals who were promised their freedom in return for military service. Regular Libyan soldiers called these fighters the "suicide squads" as they were often selected for dangerous commando operations. According to journalist Edward Cody, the Pan-African Legion contingent in Uganda included a large number of these "suicide squads". An "informed official" commented that "they generally lived up to their name" during the war. American intelligence analyst Kenneth M. Pollack argued that the Pan-African Legion soldiers deployed to Uganda were only half-trained and of comparable combat value as the militia.

+ Libyan ground equipment in Uganda Type Amount Source(s) T-55 main battle tanks 15 T-54 main battle tanks ? BTR armoured personnel carriers 12 Land Rovers with 106 mm (4.2 in) recoilless rifles dozens BM-21 Grad 12-barrel Katyusha rocket launcher variants 12 mortars ? D-30 howitzers 2 batteries

The Libyan force was well equipped with tanks as well as artillery, possessing far more firepower than the Tanzanians. According to Ugandan officer Bernard Rwehururu, however, the Libyan soldiers lacked heavier small arms, being mostly equipped with machine pistols. In addition to the ground forces, Libya also dispatched large quantities of military equipment for the Uganda Army. Much of the supplies and military hardware were stockpiled in Entebbe without ever being used in combat because Ugandan forces did not have the logistical capability to efficiently distribute them. Over the course of the war, Libyan personnel and materiel were mostly brought into Entebbe's international airport in a regular airlift. Some were also transported to Gulu in Uganda's north. There were reports about one Libyan transport aircraft getting lost and crashing in Zaire; the survivors were treated in a hospital in Kinshasa.

Besides ground troops and equipment, Libya also dispatched elements of its air force. However, it is disputed how many and which types of Libyan aircraft were sent to Uganda. The presence of at least two Tupolev Tu-22 bombers was confirmed. There were also claims about Libyan Dassault Mirages and MiG-21s in Uganda, but these were never verified. Researchers Tom Cooper and Adrien Fontanellaz have argued that Libyan short-range combat aircraft were probably not sent to Uganda due to the distance they would have had to cover without refueling. The Libyan Tu-22s were based in Nakasongola Air Base, Entebbe, and Gulu.

The Libyans found the Uganda Army soldiers badly disciplined and unmotivated; they were often left alone to fight the Tanzanians. War correspondent Al J Venter claimed that the Libyans had to repeatedly "haul [the Ugandan soldiers] out of their barracks" and summarily execute several to motivate the rest to fight. Communication between the allies was hampered by language barriers. The Libyans generally did not speak English or Swahili, the common tongues of Uganda. The Ugandan and Libyan troops were often forced to communicate by hand gestures. Many Ugandan soldiers regarded the Libyans' arrival as a chance to desert and flee the country with as much loot as possible.

Course of the intervention On 9 March over 1,000 Libyan troops were flown into Uganda. Amin ordered the Libyans, together with some Ugandan troops and PLO guerrillas, to recapture Masaka. This offensive culminated in the Battle of Lukaya which ended in defeat for the pro-Amin forces. About 200 Libyans killed at Lukaya, and many others broke and fled towards Kampala. Following the battle, new military equipment and 2,000 more militiamen were dispatched. These troops included many of those who had been lied to about their destination. According to Mustafa Abuzeid, a Libyan veteran of the war, the militiamen initially assumed to be in a Libyan agricultural project upon arriving in Uganda and seeing the lush green landscape. According to journalist Norman Kirkham, the militiamen became upset upon being informed that they were in Uganda and about to be sent into combat. There were even reports about gunfights and desertions.

The Battle of Lukaya also resulted in the Uganda Army's disintegration; Amin was consequently kept in power mostly due to the continued Libyan support. In an attempt to stem the Tanzanian advance, Gaddafi sent an ultimatum to Nyerere, demanding that he withdraw his forces in 24 hours or face the opposition of Libyan troops. Knowing that Libyan troops were already present in Uganda and had fought at Lukaya, Nyerere was surprised about the ultimatum. Regardless, he officially rejected the threat in a radio broadcast announcing that Libya's entry into the war did not change the Tanzanian government's view of Amin. Following Gaddafi admitting that his forces were involved, the Libyan ambassador to the United Nations officially justified the intervention by stating that the legitimate Ugandan government had requested Libyan aid. By late March, the Libyan press started to openly discuss the intervention, portraying it as a form of jihad against the Tanzanians.