Until 1886, the sultan of Zanzibar controlled a substantial portion of the east African coast, known as Zanj, and trading routes extending further into the continent, as far as Kindu on the Congo River. That year, the British and Germans secretly met and re-established the area under the sultan's rule. Over the next few years, most of the mainland possessions of the Sultanate were taken by European imperial powers. With the signing of the Heligoland-Zanzibar Treaty in 1890 during Ali bin Said's reign, Zanzibar became a British protectorate. In August 1896, Britain and Zanzibar fought a 38-minute war, the shortest in recorded history, after Khalid bin Barghash had taken power after Hamid bin Thuwaini's death. The British had wanted Hamoud bin Mohammed to become sultan, believing that he would be much easier to work with. The British gave Khalid an hour to vacate the sultan's palace in Stone Town. Khalid failed to do so, and instead assembled an army of 2,800 men to fight the British. The British launched an attack on the palace and other locations around the city. Khalid retreated and later went into exile. Hamoud was then installed as sultan.