The Democratic Republic of Azerbaijan proclaimed its independence on 28 May 1918, it formed all the attributes of an independent state, as well as the national army. The Democratic Republic of Azerbaijan, struggled against the aggressive policy of both the Armenians and Bolsheviks, and declared martial law in the entire territory of Azerbaijan on 19 June 1918.
On June 26, a decision was adopted on establishing a military corps in the status of a division was adopted, thus, the national army was founded. In 1918-1920, the units of the national army with a high fighting capacity, military training and discipline were formed in Azerbaijan under the supervision of the prominent Azerbaijani General Samad bey Mehmandarov, Aliagha Shikhlinskiy and other professional military figures. Within a short time the National Army together with the Islam Army of the Ottoman Empire liberated Baku and the adjacent territories from the Armenian-Bolshevik occupation. According to a decree signed by Heydar Aliyev on 22 May 1998, the 26th of June is celebrated as the Day of the Armed Forces every year.