In 1914, Aliyarbayov graduated from the Tiflis military school in 1st class. During World War I, Aliyarbayov served as a second lieutenant in the 205th Shamakhi Infantry Regiment of the 52nd Infantry Division in the Eastern Front. He later commanded a company and battalion of the regiment, fighting in several battles. Aliyarbayov was severely wounded during the mid-1916 Brusilov offensive; this was his fourth injury since the beginning of the war. He was sent to Brest for medical treatment, after which he left for Baku.