Alexander's military career began probably during the Cossack uprising of Bohdan Zynoviy Mykhailovych Khmelnytsky. In 1656 he participated in the war with the Swedes, fighting in the battles of Prostki and Filipów. In the years 1657–1659, together with Polish Hetman Stefan Czarniecki he was dispatched on Western Pomerania and Denmark. Probably commanded the Czarniecki's right wing divisions at the battle of Połonka, on June 27, 1660. He was also actively involved in Ukraine. He participated in the Battles of Lyubar and Słobodyszcze. In autumn 1663 under the leadership of Polish King John II Casimir Vasa took part in the expedition to Dniprovsky. Shortly, he defected to the field of Prince Jerzy or George Sebastian Lubomirski opposite to the last King Vasa. Later he returned to the rightful King's field and commanded troops in battle against Lubomirski’ rebels near Czestochowa.