In 1971 Uganda Army soldiers launched a military coup that overthrew the President of Uganda, Milton Obote, precipitating a deterioration of relations with neighbouring Tanzania. Tanzanian President Julius Nyerere had close ties with Obote and had supported his socialist orientation. Uganda Army Colonel Idi Amin installed himself as President of Uganda and ruled the country under a repressive dictatorship. Nyerere withheld diplomatic recognition of the new government and offered asylum to Obote and his supporters. With the approval of Nyerere, these Ugandan exiles organised a small army of guerillas, and attempted, unsuccessfully, to invade Uganda and remove Amin in 1972. Amin blamed Nyerere for backing and arming his enemies, and retaliated by bombing Tanzanian border towns. Subsequent mediation resulted in the signing of the Mogadishu Agreement, which established a demilitarised zone at the border and required that both countries refrain from supporting opposition forces that targeted each others' governments. Nevertheless, relations between the two presidents remained tense; Nyerere frequently denounced Amin's regime, and Amin made repeated threats to invade Tanzania. Uganda also disputed its border with Tanzania, claiming that the Kagera Salient—a stretch of land between the official border and the Kagera River 18 miles to the south, should be placed under its jurisdiction, maintaining that the river made for a more logical border. The circumstances immediately surrounding the outbreak of the Uganda–Tanzania War in 1978 remain unclear.