In 1920, after the Red Army invasion of Azerbaijan and the establishment of Soviet power in the country, Aliyarbayov joined the newly formed Azerbaijani Red Army. In 1922, he served in the headquarters of the People's Commissariat for Military and Naval Affairs (Narkomvoenkomrat, NKVM) of the Azerbaijani SSR. From 1920 to 1922, Aliyarbayov led the local pro-Bolshevik forces in skirmishes with local golchomag insurgents near Shusha, Kurdamir, and Aghsu.