He participated in the failed 1830–31 rebellion in Russian Poland. He then emigrated, first to France in 1832 where he studied military theory, then joined the circle of Polish magnate Adam Czartoryski. As Czartoryski's trusted man, he was sent in late 1843 to Belgrade, the capital of the Principality of Serbia, he entered the elite, befriending influential statesman Ilija Garašanin.