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).