He joined the Polotsk Cadet Corps and commenced service with the 19th Artillery Brigade.
From 1850 onwards, he fought in the Caucasian War, serving with distinction and taking part in special assignments in Daghestan.
This was followed by further success in the Khiva campaign of 1873, which saw Lomakin rise to the rank of major general and win various military awards.
In 1879, Lomakin became commander of the Akhal-Teke expedition in Turkmenistan, following the death of General I. D. Lazarev.
His memoirs of service in the Transcaspian territory were published after his death.