Before Julius Nyerere, Tanzania was a German colony and later a British mandate. Nyerere helped Tanzania gain independence in 1961 and was elected president in 1962. As president, he introduced "African Socialism" and prioritized education. Through the Arusha Declaration, he established a socialist state and nationalized parts of the economy. Nyerere also advocated for nonalignment in the Cold War and supported anti-colonial movements in Africa.