Image copyright bbc Image caption A 40-year conflict in the Philippines has cost an estimated 120,000 lives

The Philippines has reached a deal with the country's largest Muslim rebel group to share wealth generated from Mindanao's natural resources.

The Moro Islamic Liberation Front (MILF) will receive 75% of the gold, copper and other resources mined from the southern island.

It follows lengthy negotiations aimed at ending a 40-year conflict that has cost an estimated 120,000 lives.

But a rebel group not at the talks has continued attacks on the national army.

Two soldiers and five guerrillas died in an ambush by the violent break-away faction Bangsamoro Islamic Freedom Fighters (BIFF) on Saturday.

Disarming rebels

Sunday's agreement was reached after six days of talks in Malaysia's capital Kuala Lumpur.

It adds details to an outline agreement - the Framework Agreement on the Bangsamoro (FAB) - signed last October in which the Philippine government agreed to give Muslims on Mindanao more autonomy in the southern region where Muslims represent a majority in the mainly Catholic nation.

Framework deal - Key points Creates new, larger autonomous region

Gradual decommissioning of MILF forces

Guarantees democratic and human rights

Pledges development and fair sharing of natural wealth

Expansion of Sharia courts for Muslim residents

"The Parties believe that the Annex, which forms part of the FAB, will provide sufficient guidance for the crafting of the Bangsamoro Basic Law's provisions on wealth sharing and revenue generation for the Bangsamoro as envisioned by the FAB," said the government and MILF representatives in a joint statement.

Under the terms of the FAB:

The new autonomous region would be named Bangsamoro, after the Moros - or Moors, which was how the Spanish used to refer to the followers of Islam - living there

Bangsamoro's leaders would have more political and economic powers

Law enforcement would be transferred from the army to the Bangsamoro police in a "phased and gradual manner"

The needs of the region's poverty-stricken communities would be addressed

The deal makes it more likely the two sides will reach a final peace agreement to end a decades-old conflict, says BBC Asia analyst Michael Bristow.

But other aspects of a final peace agreement still need to be worked out, such as how to disarm the rebels and exactly how much autonomy the will get, he adds.

As well as the 75%-25% agreement on sharing the wealth from natural resources, the two sides agreed to split earnings from energy resources equally.

The government in Manila says a failure to bring about a binding agreement could give other groups a reason to continue fighting.

The government's chief negotiator Miriam Coronel-Ferrer told AFP a final peace deal could be signed after the Islamic holy month of Ramadan, which ends later this month.

The MILF, created after a split with another rebel group in 1977, originally wanted an independent Muslim state, but dropped this demand.

The Philippines has faced separatist movements for decades in Mindanao, where the MILF is based, and in Jolo, home to the radical Islamist Abu Sayyaf group, which is reputedly linked to al-Qaeda.

Communist rebels have also waged a guerrilla conflict over parts of the country from 1969.