Azerbaijan had actually established the Azerbaijani Armed Forces and a Ministry of Defense on June 26, 1918 with the first independence of Azerbaijan, as the Azerbaijan Democratic Republic, after the collpase of the Russian Empire in 1918 until it was invaded and annexed by the Soviet Union in 1920 which came after the Russian Empire. The Azerbaijani Armed Forces and the Ministry of Defense were established again in 1991 with the second and final independence of Azerbaijan, after the collapse of the Soviet Union, when the Azerbaijani Armed Forces were formed out of the former Soviet forces in the Azerbaijan Soviet Socialist Republic.