He began his military service in 1806 during the Wielkopolska Uprising when he personally funded the formation of the first regiment of Legia Poznanska (Poznań Legion), and took the command of the unit. He took part in the Napoleonic wars and specifically, the first Polish campaign (1806–1807), where he fought with the French at the Siege of Gdańsk (Danzig) and Siege of Kołobrzeg (Kolberg). Between 1808 and 1809 he fought in Spain, including at the Battle of Almonacid and Battle of Ocana. He was appointed as the governor of Málaga, and in 1810 was promoted to Brigadier General.