In 1971 Colonel 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. He tacitly supported a failed attempt by Obote to overthrow Amin in 1972, and after a brief border conflict he and Amin signed a peace accord. Nevertheless, relations between the two presidents remained tense, and Amin made repeated threats to invade Tanzania.