Government forces in the self-declared Somaliland republic have withdrawn from a contested town near the border of Somalia after days of deadly protests against central rule, security officials said Thursday.

Demonstrations in Las Anod turned violent last week, with government forces accused by opposition parties and rights groups of shooting dead several protesters in the disputed border town.

Las Anod is claimed by both Puntland, a northern state in Somalia, and Somaliland, which broke away from the rest of the country in 1991 but remains internationally unrecognised.

The protests first erupted after a local politician was shot dead last week. Somaliland officials, which govern the town, said deaths occurred in clashes between police and demonstrators but did not say how many.

Las Anod mayor Abdirahim Ali Ismail said armed confrontation escalated between civilians and the military in the town on Wednesday after a local merchant was shot dead.

“In order to preserve the security situation, stability of the district and the wellbeing of the civilian population, the army commanders ordered the forces to return to their camps so that the situation returns to normal,” Ismail said.

Somaliland army commanders confirmed withdrawing from the town “to avoid further escalation” but warned they will not allow the stability of the region to be compromised.

“The incident last night was unfortunately accidental, and we extend our condolences to the relatives of the victim,” Abdi Dheere, a military commander in the region, told a press briefing, referring to the killed trader.

Somaliland’s President Muse Bihi, whose administration governs from Hargeisa some 380 kilometres (240 miles) to the west, said on Wednesday that an investigation into the violence would follow once peace was restored.

“What happened in Las Anod is an incidental clash between the police and the people,” he said following a meeting of Somaliland’s upper and lower houses and its security agencies.

“It is a Somaliland problem, and we take responsibility for what happened as government and people, and we will find a solution for it.”

Somaliland was ready to defend its sovereignty after Puntland “declared a war”, he said.

Somaliland and Puntland share a long and contested border and territorial disputes between the two have been violent.

Las Anod is located along a trade corridor and control of the town has changed hands several times in recent decades.

Somaliland, a former British protectorate, prints its own currency, issues its own passports and elects its own government.

But its quest for statehood has gone unrecognised, leaving the Horn of Africa region wedged between Ethiopia, Djibouti and the rest of Somalia poor and isolated.

The region has been relatively stable in comparison to Somalia, but in recent months has witnessed political unease and violent demonstrations.

In October, a decision by the council of elders to extend the president’s term after elections were delayed prompted opposition outcry, while demonstrators were killed in anti-government protests in August.