After the February Revolution in Russia Mehmandarov resigned and left for Baku. With the establishment of the Azerbaijan Democratic Republic in 1918, Samedbey Mehmandarov became the third and last Minister of Defense of Azerbaijan. He held this position until 11th Red Army troops invaded Azerbaijan in 1920. After the fall of the national government and establishment of Soviet rule in Azerbaijan Mehmandarov was arrested, but he was released two months later. He taught in military schools and was an advisor to the Commissariat of Military and Naval Forces of the Azerbaijan SSR until his retirement in 1928.