In 1954, Julius Nyerere, a school teacher who was then one of only two Tanganyikans educated to university level, organized a political party—the Tanganyika African National Union (TANU). On 9 December 1961, Tanganyika became independent, though retaining the British monarch as Queen of Tanganyika, and Nyerere became Prime Minister, under a new constitution. On 9 December 1962, a republican constitution was implemented with Mwalimu Julius Kambarage Nyerere as Tanganyika’s first president.
Zanzibar received its independence from the United Kingdom on 10 December 1963, as a constitutional monarchy under its Sultan. On 12 January 1964, the African majority revolted against the sultan and a new government was formed with the ASP leader, Abeid Karume, as President of Zanzibar and Chairman of the Revolutionary Council. In the first few days of what would came to be known as the Zanzibar Revolution, between 5,000 and 15,000 Arabs and Indians were murdered. During a series of riots, followers of the radical John Okello carried out thousands of rapes and destroyed homes and other property. Within a few weeks, a fifth of the population had died or fled.
It was at this time that the Tanganyika army revolted and Britain was asked by Julius Nyerere to send in troops. Royal Marines Commandos were sent by air from England via Nairobi and 40 Commando came ashore from the aircraft carrier HMS Bulwark. Several months were spent with Commandos touring the country disarming military outposts. When the successful operation ended, the Royal Marines left to be replaced by Canadian troops.
On 26 April 1964, Tanganyika united with Zanzibar to form the United Republic of Tanganyika and Zanzibar. The country was renamed the United Republic of Tanzania on 29 October of that year. The name Tanzania is a blend of Tanganyika and Zanzibar and previously had no significance. Under the terms of this union, the Zanzibar Government retains considerable local autonomy.