The Anglo-Zanzibar War was fought between the United Kingdom and the Zanzibar Sultanate on 27 August 1896. The conflict lasted around 40 minutes, marking it as the shortest war in history. The immediate cause of the war was the death of the pro-British Sultan Hamad bin Thuwaini on 25 August 1896 and the subsequent succession of Sultan Khalid bin Barghash. The British authorities preferred Hamud bin Muhammed, who was more favourable to British interests, as sultan. In accordance with a treaty signed in 1886, a condition for accession to the sultanate was that the candidate obtain the permission of the Britishconsul, and Khalid had not fulfilled this requirement. The British considered this a casus belli and sent an ultimatum to Khalid demanding that he order his forces to stand down and leave the palace. In response, Khalid called up his palace guard and barricaded himself inside the palace.