The Russians strictly limited opportunities for further education, so in 1853 he enlisted in the Imperial Russian Army and entered the Nicholayev Engineering Academy (Mikołajewska Szkoła Inżynierii).
In 1862 the Imperial Russian Army promoted him to Captain and stationed him in Brest, Belarus, but he still sympathized with the Poles.