Before the Europeans
The northern Tanzanian rift is one of the places the human story starts. Olduvai Gorge and the Laetoli footprints, dated to around 3.6 million years ago, made the region central to palaeoanthropology. But the more recent past matters just as much. From roughly the 8th century, a chain of trading towns grew along the coast, part of the Swahili civilisation that linked the East African shore to Arabia, Persia, India and China.
Kilwa Kisiwani, an island town south of modern Dar es Salaam, became the richest of them, controlling the gold trade out of Sofala. Its Great Mosque and the palace of Husuni Kubwa are still there in ruins. Ibn Battuta visited in the 14th century and left one of the few written descriptions. Kiswahili — a Bantu language dense with Arabic loanwords — was the coast's common tongue long before it became a national one.
Germans, then British
In the scramble of the 1880s the mainland became German East Africa. German rule was brutal: the Maji Maji rebellion of 1905–07, in which fighters believed sacred water (maji) would turn bullets to rain, was crushed with a scorched-earth campaign and famine that killed an estimated 250,000–300,000 people. After Germany's defeat in the First World War the territory passed to Britain as the League of Nations mandate of Tanganyika.
Zanzibar's path was different. The islands had been the seat of an Omani Arab sultanate — Sultan Seyyid Said moved his capital from Muscat to Zanzibar in the 1830s — and grew rich on cloves and on the slave trade, until Britain made it a protectorate. The old Stone Town, with its carved doors and the site of the last open slave market, is now a UNESCO site.
Nyerere, ujamaa and the union
Tanganyika won independence on 9 December 1961 under Julius Nyerere and TANU, without an armed struggle. Nyerere — Mwalimu, "the teacher" — was the rare founding president who theorised his politics. The Arusha Declaration of 1967 committed the country to ujamaa, a homegrown African socialism built on villagisation and self-reliance. Millions were moved into collective villages.
The economic results were poor and the coercion real, but Nyerere delivered two things few peers did: a strong national identity through Kiswahili, and a peaceful exit. He stepped down voluntarily in 1985. The 1964 union with Zanzibar — sealed weeks after a bloody revolution overthrew the islands' sultan — created the United Republic. Zanzibar keeps its own president and parliament, and mainland–island tension over autonomy recurs at every election.
A contested opening
Tanzania moved to multi-party politics in 1992, though the ruling CCM has never lost a national election. John Magufuli, president from 2015 until his death in 2021, cut a populist, authoritarian figure — "the Bulldozer" — and downplayed COVID-19 before dying, officially of heart disease, amid widespread doubt.
His vice-president, Samia Suluhu Hassan, became the country's first woman head of state. She eased some of Magufuli's repression early on, but the run-up to the 2025 elections saw opposition arrests and the treason case against Chadema's Tundu Lissu, and the promised opening looked narrower than hoped.