The shortest war on record lasted about 38 minutes, start to surrender
When Sultan Khalid bin Barghash seized the throne of Zanzibar in 1896 without British approval, the Royal Navy issued an ultimatum, then opened fire on the royal palace when it wasn't met. The bombardment began at 9:02 am and the sultan's forces surrendered by around 9:40, making the Anglo-Zanzibar War the shortest war in recorded history. Khalid fled to German East Africa, and Britain installed a more compliant sultan the same day.
— British Colonial Office records, Anglo-Zanzibar War — 27 August 1896