In 1971, Idi Amin 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. 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. Relations between Amin and Nyerere remained tense over the following years, and Amin made repeated threats to invade Tanzania.