After the February Revolution in Russia, Ali-Agha Shikhlinski was appointed the commander of the 10th Russian army in September 1917. After the October revolution, he resigned from his position and moved to Tiflis, where he was charged with formation of the Muslim (Azerbaijani) corps. The corps supported the Ottoman Army of Islam in the Battle of Baku with Bolshevik and British forces. In January 1919, the government of Azerbaijan Democratic Republic appointed Shikhlinski a deputy to the Minister of Defense of Azerbaijan Republic Samedbey Mehmandarov. On June 28, 1919, Ali-Agha Shikhlinski was promoted to the rank of General of the Artillery of the Azerbaijani army. After the Red Army invasion of Azerbaijan and establishment of the Soviet regime in Azerbaijan in April 1920, Shikhlinski was arrested and released two months later.