Zanzibar (/ˈzænzɨbɑr/) is the semi-autonomous part of Tanzania in East Africa. It is composed of the Zanzibar Archipelago in the Indian Ocean, 25–50 kilometres (16–31 mi) off the coast of the mainland, and consists of numerous small islands and two large ones: Unguja (the main island, referred to informally as Zanzibar) and Pemba. The capital is Zanzibar City, located on the island of Unguja. Its historic centre is Stone Town, which is a World Heritage Site.
Zanzibar's main industries are spices, raffia, and tourism. In particular, the islands produce cloves, nutmeg, cinnamon, and black pepper. For this reason, the islands, together with Tanzania's Mafia Island, are sometimes called the Spice Islands (a term also associated with the Maluku Islands in Indonesia). Zanzibar is the home of the endemic Zanzibar Red Colobus Monkey, the Zanzibar Servaline Genet, and the (possibly extinct) Zanzibar Leopard.
The presence of microlithic tools suggests that Zanzibar has been home to humans for at least 20,000 years, which was the beginning of the Later Stone Age.
A Greco-Roman text between the 1st and 3rd centuries AD, the Periplus of the Erythraean Sea, mentioned the island of Menuthias (Ancient Greek: Μενουθιάς), which is probably Unguja. Little is known about the history of Zanzibar between the time of the Periplus and the death of Muhammad in 632 CE. From that point forward, wars in Asia and increasing trade motivated Persians, Arabs, and Indians to visit or migrate to Zanzibar.
Persian traders used Zanzibar as a base for voyages between the Middle East, India, and Africa. Unguja, the larger island, offered a protected and defensible harbor, so although the archipelago offered few products of value, the Persians settled at what became Zanzibar City ("Stone Town") a convenient point from which to trade with the Swahili Coast towns. They established garrisons on the islands and built the first Zoroastrian fire temples and mosques in the southern hemisphere.
The impact of these traders and immigrants on the Swahili culture is uncertain. During the Middle Ages, Zanzibar and other settlements on the Swahili Coast were advanced. The littoral contained a number of autonomous trade cities. These towns grew in wealth as the Bantu Swahili people served as intermediaries and facilitators to local, Arab, Persian, Indonesian, Malaysian, Indian, and Chinese merchants. This interaction contributed in part to the evolution of the Swahili culture, which developed its own written language. Although a Bantu language, Swahili as a consequence today includes some elements that were borrowed from other civilizations, particularly Arabic loanwords. With the wealth that they had acquired through trade, some of the Arab traders also became rulers of the coastal cities.
Vasco da Gama's visit in 1498 marked the beginning of European influence. In 1503 or 1504, Zanzibar became part of the Portuguese Empire when Captain Ruy Lourenço Ravasco Marques landed and demanded and received tribute from the sultan in exchange for peace. Zanzibar remained a possession of Portugal for almost two centuries. It initially became part of the Portuguese province of Arabia and Ethiopia and was administered by a governor general. Around 1571, Zanzibar became part of the western division of the Portuguese empire and was administered from Mozambique. It appears, however, that the Portuguese did not closely administer Zanzibar. The first English ship to visit Unguja, the Edward Bonaventure in 1591, found that there was no Portuguese fort or garrison. The extent of their occupation was a trade depot where produce was purchased and collected for shipment to Mozambique. "In other respects, the affairs of the island were managed by the local 'king', the predecessor of the Mwinyi Mkuu of Dunga." This hands-off approach ended when Portugal established a fort on Pemba around 1635 in response to the Sultan of Mombasa's slaughter of Portuguese residents several years earlier. Portugal had long considered Pemba to be a troublesome launching point for rebellions in Mombasa against Portuguese rule.
The precise origins of the sultans of Unguja are uncertain. However, their capital at Unguja Kuu is believed to have been an extensive town. Possibly constructed by locals, it was composed mainly of perishable materials.
Although there were Arabs in Zanzibar and the remainder of the Swahili Coast both before and after the Portuguese, the political situation was far different.
The older settlements prior to the arrival of the Portuguese are quite distinct from the later lordship of Oman and Maskat. When the Portuguese arrived in 1498 they found on the coast a series of independent towns, peopled by Arabs, but not united to Arabia by any political tie. Their relations with these Arabs were mostly hostile, but during the sixteenth century they firmly established their power, and ruled with the aid of tributary Arab sultans. This system lasted till 1631, when the Sultan of Mombasa massacred the European inhabitants. In the remainder of their rule[,] the Portuguese appointed European governors, who were apparently most distasteful to the natives, for they invited the Arabs of Oman, who now appear on the scene for the first time, to assist them in driving the foreigners out.