He was born in Nasliç, Manastir Vilayet, into an Albanian family. His father was a prominent civil servant of the area. From 1887 to 1890 he was educated in strategy and military geography in the Ottoman Military College, while later until 1894 he studied in Germany under Colmar Freiherr von der Goltz. As a result of his participation in the Greco-Turkish War he was promoted to the rank of Miralay (colonel). In 1908 after the Young Turk Revolution he became chief of the Ottoman general staff. During that period ( under the Young Turk Government) he was opposed to the military actions of the Ottoman army under Mahmud Shevket Pasha against Albanian nationalists during the Albanian revolts of 1910. His strong opposal to Mahmud Pasha's policies led to his dismissal and reappointment in Yemen in February 1911.