By Souleymane Ag Anara

BAMAKO (Reuters) - Fighting broke out in the town of Kidal in Mali's desert north on Thursday between pro-government militia and a Tuareg-dominated rebel coalition, town residents and the United Nations said.

The violence highlighted the increasing fragility of a U.N.-backed deal signed a year ago between the government in the southern capital Bamako and northern armed groups that was meant to end a decades-long cycle of uprisings.

Mali's U.N. peacekeeping mission, MINUSMA, said the fighting was a violation of the ceasefire both groups - the Tuareg separatist Coordination of Azawad Movements (CMA) and pro-government Gatia militia - agreed to as part of the deal.

The sound of gunfire rang out in Kidal, one of northern Mali's main towns, from around 4 p.m. (1600 GMT) and sent residents fleeing indoors for cover as clashes quickly spread.

"We were at the mosque when we heard a few gunshots," said Ahamadou Thegoum, a Kidal resident. "Fifteen minutes later, they let loose and we heard gunfire practically all over town, steady gunfire and sometimes explosions."

One young girl was killed in crossfire while a second was injured, according to the father of the dead girl. Another family member had earlier said that both girls had been killed.

A CMA fighter, who asked not to be named, claimed that four Tuareg rebels had died, while 10 Gatia fighters were killed, but the death toll could not be independently verified.

Military helicopters circled above the town during the fighting, he said, though it wasn't clear if they belonged to Mali's U.N. peacekeeping mission or a French force fighting Islamist militants in the arid Sahel region.

Kidal is a traditional stronghold of rebels claiming a Tuareg homeland they call Azawad, but the CMA and pro-government Gatia militia had peacefully shared control of Kidal since February.

Tensions have been building over the past few days, however, amid tit-for-tat violence, and both sides reinforced their positions in and around Kidal.

The government of neighboring Niger attempted to mediate between the groups, and representatives of the pro-Bamako militia and the rebels signed a truce on Sunday.

But from Wednesday, CMA fighters occupied Kidal's main roads and established positions to block Gatia from entering the town center. One CMA fighter reached by phone in Kidal said Gatia had started Thursday's clash.

"This morning CMA told the militias to stay where they were and maintain their positions outside of the town, but they tried to force their way in," he said, asking not to be named as he was not authorized to speak to the press.

Gatia leader Fahad Ag Almahmoud rejected responsibility for the violence. "CMA sought to reduce our mobility in Kidal," he said. "This afternoon one of our brigades was returning from the bush ... CMA fighters opened fire at them at close range."

Islamist militant groups, some with links to al Qaeda, hijacked a Tuareg uprising in 2012 and seized northern Mali until a French-led intervention drove them back a year later.

Last year's peace agreement signed by the government, its militia allies and the separatists was intended to ease long-standing tensions in the north and allow the army to concentrate on fighting jihadist groups.

However the deal is fraying and new groups are springing up to destabilize the West African nation.

Islamist militants killed 17 Malian soldiers and wounded 35 others earlier this week when they attacked an army base in the center of the country, firing on troop positions, burning buildings and pillaging shops.

"They defended their nation with honor and dignity. Today, they are dead, but their country will avenge them," President Ibrahim Boubacar Kéita said at a memorial ceremony for the soldiers in the town of Segou.

(Additional reporting by Cheik Amadou Diouara; writing by Joe Bavier; editing by Mark Heinrich and Cynthia Osterman)