was elected the first President of the newly independent Republic of Armenia on 16 October 1991, receiving 83% of the vote. On 18 October 1991, he signed onto Gorbachev's failed attempt to form an economic community out of the collapsing Soviet Union and preserve the economic ties between the republics (only 8 of the 15 republics agreed to sign). Ter-Petrosyan then brought Armenia into the Commonwealth of Independent States which formed after the formal abolition of the Soviet Union in December 1991. Ter-Petrosyan appointed Vazgen Sargsyan the first Defense Minister of independent Armenia in December 1991. On 28 January 1992, the Armenian government passed the historical decree "On the Ministry of Defense of the Republic of Armenia," which formally created the Armed Forces of Armenia. In late 1991 and early 1992, the fighting in Nagorno-Karabakh expanded into a full-scale war. With the rise of hostilities in Nagorno-Karabakh, in March 1992, Sargsyan announced that Armenia needed a 30,000-strong army for maintaining security. Under Ter-Petrosyan's leadership as the commander-in-chief on 9 May 1992, the Armenian forces recorded their first major military success in Nagorno-Karabakh with the capture of Shusha. Another significant victory for the Armenian forces was recorded weeks later with the capture of Lachin, which connects Armenia proper with Nagorno-Karabakh. In the summer of 1992, following the launch of Operation Goranboy, the Armenian forces had major losses. Ter-Petrosyan dismissed Defense Minister Vazgen Sargsyan, as between October 1992 and March 1993 Sargsyan served as the Presidential Adviser on Defence Affairs and the Presidential Envoy to Border Regions of Armenia, Ter-Petrosyan appointed his comrade-turned-rival Vazgen Manukyan to the post. According to Vazgen Manukyan, on several occasions, the more cautious Ter-Petrosyan was, he deliberately not fully informed about the extent of the Armenian military's participation in operations in Nagorno-Karabakh. In early April 1993, the Armenian forces captured Kelbajar, a city outside the originally contested areas, causing international attention to the conflict. Turkey closed its border with Armenia, while the United Nations passed a resolution condemning the act. Vazgen Manukyan was dismissed from his post in August 1993. In the summer of 1993, Armenian forces gained more territories and, by August controlled Fizuli, Jebrail, and Zangelan. It was estimated that during Ter-Petrosian's presidency, the significant amount of military expenditure, played a key role in the outcome of the war and the formation of the army. By early 1994, both countries were devastated by the war.