Throughout the 1880s and 1890s British and Egyptian forces conducted military operations against the Mahdiyya, an extreme Muslim religious movement which ruled Sudan until 1898 when it was finally defeated. In particular the siege of Khartoum and the subsequent death of General Charles Gordon of the Royal Engineers in January 1885, and the Dongola Campaign of 1897-98 headed by General Sir Herbert Kitchener which brought about the final defeat of the Mahdiyya are well-known episodes in history. It is against this backdrop that the first railway in Sudan was constructed.
The idea of a railway connecting Egypt with Sudan to transport passengers and freight was first proposed by the Egyptian Viceroy Said Pasha in 1860. In the following years various plans were put forward including one to build a line from Wadi Halfa following the course of the Nile to Shendi to the south. In 1873 the British firm of Appleby Brothers undertook to build the first one hundred miles. Cape gauge was selected in preference to the standard gauge used on Egyptian railways in the hope that the line would eventually connect with the