The second most important official in Nagorno-Karabakh’s leadership and the heads of the local police and security service resigned on Wednesday following anti-government protests in Stepanakert.

The unprecedented protests were sparked by a violent dispute on June 1 between security officers and other local residents. The men came to blows outside a Stepanakert car wash for still unclear reasons. Several of them turned out to be officers of Karabakh’s National Security Service (NSS).

The brawl triggered angry demonstrations against what their participants see as impunity enjoyed by law-enforcement officials and their relatives. They blocked Stepanakert’s main avenue for four days, demanding the resignation of the NSS and police chiefs.

Several individuals, including two NSS officers, were arrested in the immediate aftermath of the incident. The Karabakh government pledged to ensure an objective criminal investigation. These assurances failed to satisfy the protesters, however.

The protests ended only after an appeal from Armenia’s Prime Minister Nikol Pashinian. The latter urged the protesters on Monday to give Bako Sahakian, the Karabakh president, more time to draw “concrete conclusions” from the violence.

The chief of the Karabakh police, Kamo Aghajanian, cited “public demand” for his exit when he tendered his resignation on Wednesday morning.

The head of the NSS, Arshavir Gharamian, and his deputy, Gagik Sargsian, followed suit later in the day. Unlike Aghajanian, they did not issue statements.

Also stepping down was Arayik Harutiunian, the Karabakh state minister responsible for the government’s day-to-day affairs. He previously served as prime minister, a position formally abolished after local lawmakers controversially voted last year to extend Sahakian’s decade-long rule until 2020.

Harutiunian attributed his unexpected resignation, which was not demanded by the protesters, to popular expectations of a “new phase of reforms” in Karabakh. He said those expectations were heightened by the recent democratic revolution in Armenia which brought Pashinian to power.

“Of course we have made serious progress in terms of democratic development,” he told a news conference in Stepanakert. “But those events [in Armenia] increased popular demand [for change] in Artsakh and the authorities led by the president must take that into account.”

He said that Sahakian decided to embark on major reforms late last month and that his resignation will help to speed up their implementation.

The premier also defended his track record. He argued, in particular, that the Karabakh economy has grown by more than 10 percent annually for the last decade.

Harutiunian’s Free Fatherland party has the largest faction in the Karabakh parliament.

Harutiunian was replaced by Grigori Martirosian later in the day. Martirosian served as finance minister until now.

Sahakian also appointed the new heads of the Karabakh police and NSS.