was essential to Egypt's security and that to allow the Ansar a victory there would invite the movement to spread elsewhere. Increasing British popular support for Gordon eventually forced Prime Minister William Gladstone to mobilize a relief force under the command of Lord Garnet Joseph Wolseley. A "flying column" sent overland from Wadi Halfa across the Bayuda Desert bogged down at Abu Tulayh (commonly called Abu Klea), where the Hadendowa broke the British line. An advance unit that had gone ahead by river when the column reached Al Matammah arrived at Khartoum on 28 January 1885, to find the town had fallen two days earlier. The Ansar had waited for the Nile flood to recede before attacking the poorly defended river approach to Khartoum in boats, slaughtering the garrison, killing Gordon, and delivering his head to the Mahdi's tent. Kassala and Sennar fell soon after, and by the end of 1885, the Ansar had begun to move into the southern region. In all Sudan, only Sawakin, reinforced by Indian army troops, and Wadi Halfa on the northern frontier remained in Anglo-Egyptian hands. The Mahdists destroyed Khartoum, the city that was built by the Ottomans. All buildings were demolished and ransacked. The women were raped and forced to divorce their "kafir" husbands. It was only after the British came back after about 15 years that the city was rebuilt. By this time no historical buildings, Ottoman style mosques and architecture remained. Abdallahi ibn Muhammad Six months after the capture of Khartoum, the Mahdi died, probably of typhus (22 June 1885). The task of establishing and maintaining a government fell to his deputies—three caliphs chosen by the Mahdi in emulation of the Islamic prophet Muhammad. Rivalry among the three, each supported by people of his native region, continued until 1891, when Abdallahi ibn Muhammad, with the help primarily of the Baqqara Arabs, overcame the opposition of the others and emerged as unchallenged leader of the Mahdiyah. Abdallahi—called the Khalifa (successor)—purged the Mahdiyah of members of the Mahdi's family and many of his early religious disciples. Originally, the Mahdiyah functioned as a jihad state, run like a military camp. Sharia courts enforced Islamic law and the Mahdi's precepts, which had the force of law. After consolidating his power, the Khalifa instituted an administration and appointed Ansar (who were usually Baqqara) as amirs over each of the several provinces. The Khalifa also ruled over