MOGADISHU, Sept 5 (Reuters) - The leaders of the Somali regions of Puntland and Galmudug have agreed an immediate ceasefire and committed to a peaceful end to a dispute that has killed at least 27 people in the past week, the U.N. said on Monday.
Heavy fighting near the border between the two regions erupted last week, days before a political conference to hammer out a road map towards elections in the chaotic Horn of Africa nation.
The U.N. Political Office for Somalia said in a statement that Puntland's President Abdirahman Mohamed Mohamud and Galmudug's President Mohamed Ahmed Alin met on the sidelines of the conference in Mogadishu on Monday and agreed the truce.
"I am most gratified that the United Nations was able to bring the parties together in the margins of the Consultative Meeting and that they decided, in a spirit of brotherly reconciliation, to put aside their differences which had threatened to undermine this important moment in the peace process," the U.N. special envoy Augustine Mahiga said.
Puntland's security ministry had said its forces had repelled a two-day attack by al Shabaab militants in the north of Galkayo town, which its troops control, and accused the authorities of the Galmudug region, who control the south of Galkayo, of harbouring the militants.
Galmudug's president denied supporting al Shabaab or fighters allied to the militants and told Reuters the fighting was between two sub-clans of the same clan.
Somalia has been mired in conflict and awash with weapons since the downfall of dictator Mohamed Siad Barre 20 years ago. It has become a haven for foreign jihadists bent on striking the region's main economies, security experts say.
The U.N. said the two presidents had agreed to implement an immediate ceasefire, establish and maintain direct communication, address future issues in a non-violent manner and recognise they face a comment threat from insurgents.
"Puntland and Galmudug are on Somalia's front lines in the ongoing fight against violent extremists that increasingly are relying on terror tactics to try and disrupt the peace process," said Mahiga.
Residents in Galkayo town said there was sporadic fighting early on Monday morning, but it died down in the afternoon. (Additional reporting by Mohamed Ahmed; Editing by David Clarke)