With the dissolution of the Soviet Union, the Nagorno-Karabakh conflict plunged into all-out war. Kocharyan participated in the Capture of Shusha in May 1992, one of the most significant Armenian victories of the war. In August 1992, Kocharyan became chairman of the State Defense Committee, an extraordinary body which held all executive powers during the war. That year he also became prime minister of the Nagorno-Karabakh Republic. Kocharyan coordinated the war effort of the Nagorno-Karabakh Republic in its war against Azerbaijan, which ended in an Armenian victory with the signing of a ceasefire agreeement in May 1994 by representatives of Armenia, Azerbaijan and the NKR. Kocharyan was elected NKR's first president on December 24, 1994 by the decision of the NKR Supreme Soviet. He was reelected by popular vote in November 1996.