Hizbul Islam, a coalition of groups fighting Somali government forces and African Union peacekeepers, has agreed a ceasefire with Somalia's new cabinet, Al Jazeera has learned.
Sharif Ahmed, the president of Somalia, said he had agreed proposals for a truce with the leading rebel group and also accepted the implementation of sharia, or Islamic law, in the country.
"I met with religious leaders and elders and accepted their demand for ceasefire and reconciliation with the opposition members, and I call on all opposition parties to halt the unnecessary violence," Ahmed said.
"The mediators asked me to introduce sharia [Islamic law] in the country and I agreed," he said.
'End to violence'
Ahmed's announcement came on the same day that Omar Abdirahsid Sharmarke, the Somali prime minister, led the inaugural session of the new government in Mogadishu, the Somali capital.
Sheikh Bashir Ahmed, the chairman of Somalia's Union of Islamic Scholars, said Hizbul Islam had reached a favourable deal with government.
"We asked the president to implement Islamic sharia in the country and accept mediation … He agreed and we hope this will end the violence in the country," he said.
The ceasefire deal follows fierce fighting in Mogadishu this week between opposition fighters and government and African Union forces.
At least 49 civilians were killed in the clashes in the capital, the independent Elman Human Rights Organisation has said.
Hizbul Islam is against the presence of AU troops in Somalia and has said it will battle them until they leave the country.
The truce is unlikely to be extended to al-Shabab, a stronger opposition faction, that has already imposed its own version of sharia across parts of Somalia.
Al-Shabab is listed by the US State Department as a "terrorist organisation" with links to al-Qaeda, a designation that the group denies.