The Somali Cabinet voted to make Islam the basis of the country's legal system in a bid to undercut an increasingly fractured Islamic insurgency.

The move on Tuesday was an attempt to isolate more extreme elements of the insurgency by agreeing to a demand supported by more moderate elements and much of the Somali population.

Several more moderate insurgent groups had said they would stop fighting the government if Islamic law, or Shariah, was formally introduced. They include the Islamic Party, an alliance of four insurgent groups that control parts of the capital and have influence in the port town of Kismayo; and Ahlu-sunah Wal-jamea, which controls parts of central Somalia.

The al-Shabab group, which controls the main cities in the south, has said it does not recognize the legitimacy of the government and is seen as waging a battle to seize direct control of the country. The U.S. State Department says al-Shabab has ties to al-Qaida

The bill introducing Islamic law must still be approved by parliament, which is expected to hear it within days.

Information Minister Farhan Ali Mohamed said imposing Shariah would help end insurgent attacks

He said that if the bill passed a committee of cabinet members and members of a national clerics' council would be set up to examine how to bring the country's constitution into line with Muslim principles. He did not go into specifics.

The ministry of justice would still select judges and police would have the power to detain suspects and carry out sentences, he said.

The insurgency, never a completely cohesive force, has become increasingly divided after the appointment of Sheik Ahmed Sheik Sharif to the country's presidency this January.

President Sharif is a former Islamic fighter who describes himself as a moderate and has distanced himself from more hardline elements of the insurgency who have attacked African Union peacekeepers.

Thousands of Somalis have been killed in battles between the insurgents and pro-government forces in the past two years. The fighting has been complicated by a web of clan militias, the involvement of neighboring countries, and freelance bandits who prey on civilians.

Some scholars say the country's transitional charter, which created the current government, is un-Islamic because it was not based on the Quran, although it does stipulate that Islam shall form the basis of Somali law.

Non-governmental Islamic courts are one of the few functioning institutions in the chaotic Horn of Africa nation, which has been without an effective central government since clan leaders overthrew a socialist dictator in 1991 but then turned their militias on each other. In 2006, the community-based courts formed an alliance that took over the capital of Mogadishu and much of the south before Ethiopian troops supporting the shaky and corrupt U.N.-backed government chased them from power.

The Ethiopians left Somalia at the beginning of this year as part of a peace deal and parliament elected Sharif as the country's leader after the former president resigned.