Born in 1790 in Poznań, at the age of 16 he joined the army of the Napoleonic Duchy of Warsaw. During the 1812 invasion of Russia he was taken prisoner by the Russians in the Battle of Bobruysk. Released after the war, he returned to Poland and joined the armed forces of the newly established Kingdom of Poland in the rank of captain.