He was an active campaigner for the nationalist movement in the 1950s, forming the Tanganyika African National Union (1954). He served as Prime Minister of Tanganyika following its independence in 1961 and became President a year later. In 1964 he successfully negotiated a union with Zanzibar and remained President of the new state of Tanzania until his retirement.