Khartoum was founded in 1821 as part of Ottoman Egypt, north of the ancient city of Soba. While the United Kingdom exerted power over Egypt, it left administration of the Sudan to it until Mahdist forces took over Khartoum. The British attempted to evacuate Anglo-Egyptian garrisons from Sudan but the Siege of Khartoum in 1884 resulted in the capture of the city by Mahdist forces and a massacre of the defending Anglo-Egyptian garrison. In 1898 Khartoum was reoccupied by British forces; it served as the seat of the Anglo-Egyptian Sudan government until 1956.