Following the Red Army invasion of Azerbaijan, Vali bey Yadigarov continued fighting against the Bolshevik invaders until March 1921, when he left his homeland, and via Turkey and Romania left for Poland. In November 1922 he was officially accepted into the Polish Army, with the rank of the rittmeister.