A British Protectorate
In September 1889 Khalifa signed an agreement with the British government agreeing to abolish slavery in his territories. Anybody who entered the sultan's realms, and any children born, would be free. Britain and Germany were awarded a permanent right to search for slaves in Zanzibar's waters. As a sign of Britain's appreciation, Khalifa was knighted, but less than a month later he died, aged 36.
Khalifa's brother, Ali bin Said was the fourth and last of Said's sons to become Sultan of Zanzibar. On 1 August 1890 Ali signed an anti-slavery treaty forbidding the purchase and sale of slaves. With the end of the slave trade, the only viable export from the interior was ivory, by now a rapidly waning asset.
Meanwhile in the interior Karl Peters entered Uganda in February 1890 and claimed the territory for Germany, just ahead of Sir Frederick Jackson from England. The British politician Lord Robert Salisbury realised that control of the Upper Nile could lead indirectly to the control of the Suez Canal and thus the trade route to India. Germany was persuaded to renounce any claims over Uganda in return for British support of the Kaiser against the major European powers of the day, France and Russia.
By the second Anglo-German agreement (the Treaty of Zanzibar) of 1 July 1890, Germany agreed to recognise a British protectorate over the Sultanate of Zanzibar, and to abandon any claim to Witu and the country inland as far as the Upper Nile. Germany also abandoned any claim to the west of Lake Nyasa but, in return, gained sovereignty over the coast of German East Africa, later to become Tanganyika. The British–German border was continued westwards across Lake Victoria to the boundary of the Belgian territory of Congo, thus securing Uganda for Britain. The British coastal strip (which still belonged to the Sultan of Zanzibar) was removed from the control of the British East Africa Company and administered by the British East Africa Protectorate, later to become Kenya and Uganda.
In exchange for the thousands of square miles of east African territory, including the islands of Zanzibar (Unguja and Pemba) which it gave up to British control, Germany gained Heligoland, a strategically important small island off the German coast which lay near the mouth of the Kiel Canal.
In 1891 a constitutional government was established in Zanzibar, with General Sir Lloyd Mathews as first minister. But although Zanzibar enjoyed the status of a British protectorate, the island's importance as a commercial centre was declining further in favour of Mombasa.
The British now controlled Zanzibar, so when Sultan Ali died in March 1893, without making a will, they proclaimed Hamad, son of Thuwaini (the former sultan of Oman), as sultan.
During Hamad's reign, in November 1895, Zanzibar issued its first stamps (from about 1875 the island had been using Indian stamps with 'Zanzibar' overprinted). Then a newspaper, the Gazette for Zanzibar and East Africa, was produced. It was followed by others in English, Arabic, Swahili and Urdu.