Media playback is unsupported on your device Media caption The new autonomous region is to be named Bangsamoro, after the Moros living there

The Philippine government has reached a framework peace agreement with the country's largest Muslim rebel group, President Benigno Aquino says.

The deal follows long negotiations with the Moro Islamic Liberation Front (MILF) to end a 40-year conflict that has cost more than 120,000 lives.

It provides for a new autonomous region in the south, where Muslims are a majority in a mainly Catholic country.

The MILF is "very happy" with the deal, a spokesman was quoted as saying.

The agreement was reached after talks in Malaysia and is expected to be signed formally on 15 October in the Philippine capital, Manila.

Analysis Both sides in these long-running negotiations knew there needed to be serious compromises. The government has had to concede that many Muslims living in the southern Philippines believe the existing autonomous region is too small and its leaders do not have enough real power. The rebels have had to back down too - their initial demand had been for an entirely separate state. Both sides also know there's huge pressure to get this agreement right. In 2008, a deal was about to be signed when local Christian groups complained they had not been fully consulted, and the Supreme Court blocked the agreement. Within weeks conflict had resumed, and hundreds of thousands of civilians were forced to flee their homes. This time, widespread consultations and a public vote have been built into the process, in the hope that finally a lasting peace can be reached.

A copy of the framework deal says the parties commit to reaching a "comprehensive deal" by the end of the year.

"This framework agreement paves the way for a final and enduring peace in Mindanao," President Aquino said in a speech to announce the deal, referring to the main southern region.

But he added: "The work does not end here. There are still details that both sides must hammer out."

Correspondents say the agreement marks a major breakthrough, though previous peace efforts have broken down and negotiations with the MILF over the last 15 years were interrupted by violence.

The Philippine government's chief negotiator Marvic Leonen told the BBC that the new peace deal has more political support than previous agreements, after the negotiation panel held more than 100 consultations with Muslims, Christians, and local and regional governments.

The MILF's vice chairman for political affairs Ghazali Jaafar told AFP news agency: "We are very happy. We thank the president for this."

It is hoped that the agreement could be implemented on the ground by the end of President Aquino's term in 2016.

'Casting aside distrust'

President Aquino said the new autonomous region would be named Bangsamoro, after the Moros living there.

"This framework agreement is about rising above our prejudices," the president said.

"It is about casting aside the distrust and myopia that has the plagued efforts of the past."

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

Sunday's agreement provides for the creation of a "transition commission" tasked with drafting a law to implement the framework deal.

The draft agreement would give the leaders of the Bangsamoro more political and economic powers, promises the people a "just and equitable share" of the region's abundant natural resources, and pledges to address the needs of poverty-stricken communities.

It also provides for the MILF to "undertake a graduated program for decommissioning of its forces" and says both sides would work for "reduction and control of firearms and the disbandment of private armies and other armed groups".

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

The MILF, created after a split with another rebel group in 1977, had earlier dropped its demand for an independent Muslim state.

President Aquino acknowledged on Sunday that the current autonomous region in the same area, created in 1989, had been a "failed experiment".

Malaysian Prime Minister Najib Razak, whose country has brokered peace talks since 2001, said he was "delighted" at the "historic deal".

"The rights, dignity and future prosperity of the Bangsamoro people will be protected, while at the same time the sovereignty and constitution of the Philippines will be preserved," he said.

The Philippines is made up of more than 7,000 islands, with a population of about 95 million. It has faced separatist movements 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 over much of the country from 1969.