Called to the depot in 1798, he succeeded brilliantly in his exams and was made a captain on attachment to the engineers. He became aide-de-camp to Marshal Berthier in 1800, a post he retained until 1812 and in which he took an active part in practically all of the Napoleonic campaigns. He was wounded and captured in Spain. He was promoted to full captain after Marengo and chef de bataillon after Austerlitz, also becoming a knight of the Légion d'honneur and a colonel at the Siege of Saragossa.