establishing a bona fide Egyptian military. Prior to his rule, Egypt had been governed by the Ottoman Empire, and while he still technically owed fealty to the Ottoman Porte, Muhammad Ali sought to gain full independence for Egypt. To further this aim, he brought in European weapons and expertise, and built an army that defeated the Ottoman Sultan, wresting control from the Porte of the Levant, and Hejaz. The Egyptian Army was involved in the following wars during Muhammad Ali's reign: Egyptian conquest of Sudan (1820–1824) Greek War of Independence Egyptian–Ottoman War (1831–1833) Egyptian–Ottoman War (1839–1841) and during the reign of khedives Abbas I, Sa'id Pasha, Isma'il Pasha and Tewfik Pasha: Crimean War Second Franco-Mexican War Cretan Revolt (1866–1869) Egyptian–Ethiopian War Serbian–Ottoman Wars (1876–1878) Russo-Turkish War (1877–1878) Mahdist War Anglo-Egyptian War as well as several expeditions in Sudan during the 1850s, 60s and 70s, and rebellions (mainly in Upper Egyptian Provinces in the 1860s and 1870s, most notably The Axes' Rebellion that occurred from 1864 to 1865 and was started by tens of thousands of Upper Egyptian separatist fellahin led by Sheikh Ahmad Al Tayyib which started with a minimal victory for them in the beginning, successfully seizing all of Upper Egypt under their control. Later in war, the Egyptian government forces managed to defeat the rebels in a series of battles and recaptured all of Upper Egypt. In 1882 Valentine Baker ("Baker Pasha") was offered the command of the newly formed Egyptian Army, which he accepted. On his arrival at Cairo, however, the offer was withdrawn and he only obtained command of the Egyptian police. In this post he devoted by far the greater amount of his energy to the training of the gendarmerie, which he realised would be the reserve of the purely military forces. Egypt was then involved in the long-running 1881–1899 Mahdist War in the Sudan. Making of a professional army During Muhammad Ali Pasha's reign, the Egyptian army became a much more strictly regimented and professional army. The recruits were separated from daily civilian life and a sense of impersonal law was imposed. Muhammad Ali Pasha previously attempted to create an army of Sudanese slaves and Mamluks, but most died under the intense military training and practices of the Pasha. Instead, the Pasha enforced conscription in 1822 and the new military recruits were mostly Egyptian farmers, also known as fellah. Because of harsh military practices,