The first permanent residents of Zanzibar seem to have been the ancestors of the Hadimu and Tumbatu, who began arriving from the E African mainland c.A.D. 1000. They had belonged to various mainland ethnic groups, and on Zanzibar they lived in small villages and did not coalesce to form larger political units. Because they lacked central organization, they were easily subjugated by outsiders.
Traders from Arabia, the Persian Gulf region of modern Iran (especially Shiraz), and W India probably visited Zanzibar as early as the 1st cent.; they used the monsoon winds to sail across the Indian Ocean and landed at the sheltered harbor located on the site of present-day Zanzibar town. Although the islands had few resources of interest to the traders, they offered a good point from which to make contact with the towns of the E African coast.
Traders from the Persian Gulf region began to settle in small numbers on Zanzibar in the late 11th or 12th cent.; they intermarried with the indigenous Africans and eventually a hereditary ruler (known as the Mwenyi Mkuu or Jumbe), emerged among the Hadimu. A similar ruler, called the Sheha, was set up among the Tumbatu. Neither rulers had much power, but they helped solidify the ethnic identity of their respective peoples.
The Chinese admiral Cheng Ho (Zheng He) moored his vast trading fleet in the Zanzibar harbor early in the 15th cent. The first European to visit Zanzibar was the Portuguese navigator Vasco da Gama in 1499; by 1503 the Portuguese had gained control of Zanzibar, and soon they held most of the E African coast. The Portuguese established a trading station and a Roman Catholic mission in Zanzibar and dominated the island for some 200 years. Nonetheless, their cultural impact proved to be minimal. In 1698, Arabs from Oman ousted the Portuguese from E Africa, including Zanzibar.
The Omanis gained nominal control of the islands, but until the reign of Sayyid Said (1804–56) they took little interest in them. Said recognized the commercial value of E Africa and increasingly turned his attention to Zanzibar and Pemba. In 1840 he permanently moved his court to Zanzibar town, and proceeded to exploit the natural resources of the island by planting thousands of clove trees.
Said brought many Arabs with him, and they gained control of Zanzibar's fertile soil, forcing most of the Hadimu to migrate to the eastern part of Zanzibar island. The Hadimu were also obligated to work on the clove plantations. Said controlled much of the E African coast, and Zanzibar became the main center of the E African ivory and slave trade. Some of the slaves were used on the clove plantations, and others were exported to other parts of Africa and overseas. Zanzibar's trade was run by Omanis, who organized caravans into the interior of E Africa; the trade was largely financed by Indians resident on Zanzibar, many of whom were agents of Bombay firms.
On Said's death in 1856 his African and Omani holdings were separated, with his son Majid becoming sultan of Zanzibar. Majid was succeeded as sultan by Barghash in 1870, by Khalifa in 1888, by Ali ibn Said in 1890, by Hamid ibn Thuwain in 1893, by Hamoud ibn Muhammad in 1896, by Ali in 1902, by Khalifa ibn Naroub in 1911, by Abdullah ibn Khalifa in 1960, and by Jamshid ibn Abdullah in 1963.
From the 1820s, British, German, and U.S. traders were active on Zanzibar. As early as 1841 the representative of the British government on Zanzibar was an influential adviser of the sultan. This was especially the case under Sir John Kirk, the British consul from 1866 to 1887. In a treaty with Great Britain in 1873, Barghash agreed to halt the slave trade in his realm. During the scramble for African territory among European powers, Great Britain gained a protectorate over Zanzibar and Pemba by a treaty with Germany in 1890. The sultan's mainland holdings were incorporated in German East Africa (later Tanganyika), British East Africa (later Kenya), and Italian Somaliland.
The British considered Zanzibar an essentially Arab country and maintained the prevailing power structure. The office of sultan was retained (although stripped of most of its power), and Arabs, almost to the exclusion of other groups, were given opportunities for higher education and were recruited for bureaucratic posts. The chief government official during the period 1890 to 1913 was the British consul general, and from 1913 to 1963 it was the British resident. From 1926 the resident was advised by a legislative assembly.
After World War II political activity in Zanzibar increased. In the 1950s three main political parties were established—the Zanzibar Nationalist party (ZNP) and its offshoot the Zanzibar and Pemba People's party (ZPPP), both of which principally represented the Arabs, and the Afro-Shirazi party (ASP), whose followers were Africans. In 1957 popularly elected representatives sat on the legislative council for the first time, and in 1961, they were given a majority of seats. In June, 1963, Zanzibar gained internal self-government, and a ZNP-ZPPP coalition emerged victorious in elections held in July. On Dec. 10, 1963, Zanzibar (including Pemba) became independent, with Sultan Jamshid ibn Abdullah as head of state and Prime Minister Muhammad Shamte Hamadi, also an Arab, as the leader of government.
On Jan. 12, 1964, this arrangement was overthrown by a violent leftist revolt of the Africans led by John Okello. A republic was declared, with Abeid Karume of the ASP as its president and as head of the Revolutionary Council (the country's chief governmental body). The sultan was forced into exile, all land was nationalized, the ZNP and ZPPP were banned, and numerous Arabs were imprisoned. Subsequently, many other Arabs and some Indians left the country. Three months later Zanzibar and Tanganyika agreed to merge, and the resulting republic was renamed Tanzania in Oct., 1964.
Zanzibar retains considerable independence in internal affairs, but its foreign relations and defense are handled by the central government. Zanzibar's chief executive serves as the first vice president of Tanzania when Tanzania's president is Tanganyikan, and as second vice president when Tanzania's president is Zanzibari. In 1979 a separate constitution was approved for Zanzibar.
In 1984, Zanzibar's president, Aboud Jumbe, resigned, as the Tanzanian government appeared to be seeking greater control over Zanzibar. Ali Hassan Mwinyi, a mainland loyalist, took over as president and several secessionists were arrested. Mwinyi went on to introduce liberal reforms in Zanzibar and in the mainland and became president of Tanzania in 1986. In 1990, Dr. Salmin Amour became president of Zanzibar; he was returned to office in a 1995 vote that observers said was rigged.
Amani Karume was elected president in 2000 in an election with such blatant irregularities that international observers denounced it as showing contempt for Zanzibar's citizens; the opposition, which favored greater independence, had been expected to do well. An accord signed in 2001 called for a number of electoral and governmental reforms that were designed to end political tensions.
Karume was reelected in 2005 in an election that was criticized for some irregularites and political violence and denounced by the opposition, but it was also regarded as an improvement over previous elections. Subsequent negotiations to establish a coalition government that would include the opposition, which is especially strong on Pemba, proved unsuccessful, but in 2010 voters in a referendum approved the formation of proportionally based power-sharing coalition governments. A 2006 court challenge by Zanzibari activists to the legality of the 1964 Act of Union that formed Tanzania was dismissed by the High Court of Zanzibar. Ali Mohamed Shein, the ruling party candidate, was narrowly elected president in 2010.