 He was a volunteer in the First Battalion of Italian Students of the provisional Lombard government of 1848, and fought in the First Italian War of Independence against the Austrian Empire which broke out that year.In 1851 he graduated in Engineering and Architecture in Pavia.In 1859 he again enrolled as volunteer in the Cacciatori delle Alpi corps, obtaining the grade of second lieutenant and a Silver Medal for Military Value.