Since his birthplace was then in the Kingdom of Lombardy-Venetia within the Austro-Hungarian Empire, he began his military career in the Austro-Hungarian Army as an artillery lieutenant under Benedek. After the Austro-Prussian War and the Austrian defeat at Sadowa, he decided to move to the Italian army in 1867. Completing his studies at the Scuola di Guerra, he was attached to Italy's general staff and in 1896 left for Eritrea as an infantry colonel to fight against Ethiopia and the Dervishes. In those campaigns he rose to major general.