The presence of microlithic tools attests to at least
20,000 years of human occupation of Zanzibar.
The islands became part of the historical record of the wider world when Arab traders discovered them and used them as a base for voyages between Arabia, India, and Africa. Unguja offered a protected and defensible harbour, so although the archipelago offered few products of value, the Arabs settled at what became Zanzibar City (Stone Town) as a convenient point from which to trade with East African coastal towns. They established garrisons on the islands and built the first mosque in the Southern hemisphere.
During the Age of Exploration,
the Portuguese Empire
was the first European power to gain control of Zanzibar, and the Portuguese
kept it for nearly 200 years.
In 1698, Zanzibar fell under the control of the Sultanate of Oman, which developed an
economy of trade and cash crops with a
ruling Arab elite. Plantations were developed to grow spices, hence the term Spice Islands.
Another major trade good for Zanzibar was ivory. The Sultan of Zanzibar controlled a substantial portion of the East African coast, known as Zanj; this included Mombasa, Dar es Salaam, and trading routes that extended much further inland, such as the route leading to Kindu on the Congo River.
Sometimes gradually and sometimes by fits and starts,
control of Zanzibar came into the hands of the British Empire; part of the political
impetus for this was the 19th century movement for the abolition of the slave trade.
The relationship between Britain and the nearest relevant colonial power, Germany, was formalized by the 1890 Helgoland-Zanzibar Treaty, in which Germany pledged not to interfere with British interests in insular Zanzibar. That year, Zanzibar became a protectorate (not a colony) of Britain.
From 1890 to 1913, traditional viziers were appointed to govern as puppets, switching to a system
of British residents (effectively governors) from 1913 to 1963.
The death of the pro-British Sultan Hamad bin Thuwaini on 25 August 1896 and the succession of Sultan Khalid bin Barghash of whom the British did not approve led to the Anglo-Zanzibar War. On the morning of 27 August 1896, ships of the Royal Navy destroyed the Beit al Hukum Palace. A cease fire was declared 38 minutes later, and to this day the bombardment stands as the shortest war in history.
The islands gained independence from Britain in December 1963 as a constitutional monarchy.
A month later, the bloody Zanzibar Revolution, in which thousands of Arabs and Indians were killed in a genocide and thousands more expelled, led to the establishment of the Republic of Zanzibar and Pemba.That April, the republic was subsumed by the mainland former colony of Tanganyika.
This United Republic of Tanganyika and Zanzibar was soon renamed the United Republic of Tanzania, of which Zanzibar remains a semi-autonomous region.