The Zanzibar Archipelago, now part of the Southeast African republic of Tanzania, is a group of islands lying in the Indian Ocean off the coast of Tanganyika. It comprises the main southern island of Unguja (also known as Zanzibar), the smaller northern island of Pemba, and numerous surrounding islets. With a long history of Arab rule dating back to 1698, Zanzibar was an overseas territory of Oman until it achieved independence in 1858 under its own Sultanate. In 1890 during Ali ibn Sa'id's reign, Zanzibar became a British protectorate, and although never formally under direct rule was considered part of the British Empire.
By 1964, the country was a constitutional monarchy ruled by Sultan Jamshid bin Abdullah. Zanzibar had a population of around 230,000 Africans—some of whom claimed Persian ancestry and were known locally as Shirazis—and also contained significant minorities in the 50,000 Arabs and 20,000 South Asians who were prominent in business and trade. The various ethnic groups were becoming mixed and the distinctions between them had blurred; according to one historian, an important reason for the general support for Sultan Jamshid was his family's ethnic diversity. However, the island's Arab inhabitants, as the major landowners, were generally wealthier than the Africans; the major political parties were organised largely along ethnic lines, with Arabs dominating the Zanzibar Nationalist Party (ZNP) and Africans the Afro-Shirazi Party (ASP). The ZNP looked towards Egypt as its model, which caused some tensions with the British colonial officials, but Zanzibar had been for centuries dominated by its Arab elite, and the Colonial Office could not imagine a Zanzibar ruled by the blacks.
In January 1961, as part of the process of decolonisation, the island's British authorities drew up constituencies and held democratic elections. Both the ASP and the ZNP won 11 of the available 22 seats in Zanzibar's Parliament, so further elections were held in June with the number of seats increased to 23. The ZNP entered into a coalition with the Zanzibar and Pemba People's Party (ZPPP) and this time took 13 seats, while the ASP, despite receiving the most votes, won just 10. Electoral fraud was suspected by the ASP and civil disorder broke out, resulting in 68 deaths. To maintain control, the coalition government banned the more radical opposition parties, filled the civil service with its own appointees, and politicised the police.
In 1963, with the number of parliamentary seats increased to 31, another election saw a repeat of the 1961 votes. Due to the layout of the constituencies, which were gerrymandered by the ZNP, the ASP, led by Abeid Amani Karume, won 54 percent of the popular vote but only 13 seats, while the ZNP/ZPPP won the rest and set about strengthening its hold on power. The Umma Party, formed that year by disaffected radical Arab socialist supporters of the ZNP, was banned, and all policemen of African mainland origin were dismissed. This removed a large portion of the only security force on the island, and created an angry group of paramilitary-trained men with knowledge of police buildings, equipment and procedures. Furthermore, the new Arab-dominated government made it clear that in foreign policy, the Sultanate of Zanzibar would be seeking close links with the Arab world, especially Egypt and had no interest in forging relationships with the nations on the African mainland as the black majority wished. Slavery had been abolished in Zanzibar in 1897, but much of the Arab elite who dominated the island's politics made little effort to hide their racist views of the black majority as their inferiors, a people fit only for slavery. In Parliament, the Minister of Finance Juma Aley responded to questions from Karume by insultingly saying he need not answer questions from a mere "boatman". Aley further explained in another speech in Parliament that if Arabs were over-represented in the Cabinet, it was not because of racism, but rather it was only because the mental abilities of blacks were so abysmally low and the mental abilities of Arabs like himself were so high, a remark that enraged the black majority. Memories of Arab slave-trading in the past (some of the older blacks had been slaves in their youth) together with a distinctly patronizing view of the Arab elite towards the black majority in the present meant that much of the black population of Zanzibar had a ferocious hatred of the Arabs, viewing the new Arab-dominated government as illegitimate. The government did not help broaden its appeal to the black majority by drastically cutting spending in schools in areas with high concentrations of blacks. The government's budget with its draconian spending cuts in schools in black areas was widely seen as a sign that the Arab-dominated government was planning to lock the blacks in a permanent second-class status.
Complete independence from British rule was granted on 10 December 1963, with the ZNP/ZPPP coalition as the governing body. The government requested a defence agreement from the United Kingdom, asking for a battalion of British troops to be stationed on the island for internal security duties, but this was rejected as it was deemed inappropriate for British troops to be involved in the maintenance of law and order so soon after independence. Much of the cabinet which was seeking closer ties with Egypt (ruled by the radical, anti-Western nationalist Nasser) did not want British troops in Zanzibar anyway. British intelligence reports predicted that a civil disturbance, accompanied by increasing communist activity, was likely in the near future and that the arrival of British troops might cause the situation to deteriorate further. However, many foreign nationals remained on the island, including 130 Britons who were direct employees of the Zanzibar government.
In 1959, a charismatic Ugandan named John Okello arrived in Pemba, working as a bricklayer and in February 1963 moved to Zanzibar. Working as an official in the Zanzibar and Pemba Paint Workers' Union and as an activist in the ASP, Okello had built himself a following and almost from the moment that he arrived on Zanzibar had been organizing a revolution that he planned to take place shortly after independence.