Up to 20 people have been killed and at least 40 others wounded, according to health workers, in two days of fighting in northern Mali threatening a shaky year-old peace deal.

The Tuareg-dominated Coordination of Azawad Movements (CMA) and rival Gatia militia fighters, who had peacefully shared control of the town of Kidal since February, clashed for a second day on Friday, the UN mission in Mali (MINUSMA) said in a statement

Both groups signed a UN-backed deal a year ago with the government in Bamako, the capital in southern Mali, that was intended to ease tensions and let the army focus on defeating other armed groups in the desert north.

READ MORE: Armed groups kill 17 soldiers at Mali base

A nurse at the main health centre in Kidal, one of the largest towns in northern Mali, said she had seen about 20 dead, both at the clinic and on the town's streets.

"There are wounded people everywhere. Forty wounded, with four bad cases. One of them was shot in the throat, another in the back, another in the abdomen," a doctor at the health centre told the Reuters news agency by telephone, asking not to be named.

Red Cross volunteer Ahamed Ag Mohomedine told Reuters he had counted over 15 bodies, adding many wounded had been taken to MINUSMA's base in Kidal.

Both armed groups gave death tolls from the fighting that were lopsided in their own favour and could not be independently verified.

Mali's government, which has not had a military presence in Kidal since clashes between the army and Tuareg rebels killed 50 soldiers there in 2014, urged both sides to end the fighting.

"The government of the Republic of Mali considers that the situation created by these clashes constitutes a serious threat to the implementation of the peace accord," it said in a statement.

Talk To Al Jazeera: Peace process won't be derailed, says Mali's president

MINUSMA said it had stationed troops in heavily populated areas to protect civilians.

The UN also deployed drones to monitor the fighting, and a regionwide French counter-terrorism mission used helicopters to patrol the skies above the town, MINUSMA spokeswoman Radhia Achouri told Reuters.

"Our main concern is that civilians are in the line of fire," she said, adding that some town residents had taken shelter inside the MINUSMA camp overnight.

'We control the town in its entirety'

The gunfire had largely subsided by mid-afternoon on Friday, as the CMA claimed to have driven Gatia fighters from Kidal.

"We control the town in its entirety along with the surrounding areas. Calm has returned," said CMA spokesman Almou Ag Mohamed.

Two officers in the pro-government militia confirmed that Gatia had withdrawn from the town.

"We decided to draw back from Kidal, but we are in the process of reorganising," one of the officers said, asking that his name not be used for his protection.

The UN called for an immediate cessation of hostilities and said that it was working with leaders of both groups to mediate the conflict and resume the peace process.

The latest bout of violence erupted on the same day Mali declared a 10-day state of emergency and a three-day national mourning period after 17 Malian soldiers were killed and 35 others wounded in an attack on a military base in the town of Nampala in central Mali. 

More than 250,000 orphans at risk in Mali

Source: Agencies