In the Hungarian revolution of 1848 he was appointed the commanding officer of the Northern Army. After his successes he was soon promoted and Lajos Kossuth appointed him the Hungarian commander-in-chief. He was hampered by the jealousy of Artúr Görgey and after the defeat at the Battle of Kápolna, he resigned. After the Battle of Temesvár (where he was commander until the arrival of Józef Bem) and Kossuth's resignation, he fled to Turkey, where he (together with many other prominent Polish officers) entered the service of sultan Mahmud II. However, in 1850 he returned to Paris, where he died.