Manila: The Philippines moved a step closer on Wednesday to ending decades of conflict on its resource-rich island of Mindanao, after lawmakers approved a bill that will eventually allow self-rule for the country’s Muslim minority.

Lower house lawmakers voted 227 to 11, with 2 abstentions, to pass the Bangsamoro Basic Law (BBL), seen as key to forging lasting peace with separatist rebels and thwarting the rise of Islamist extremism in the nation’s poorest and most dangerous region.

The bill is the result of a 2014 peace deal between the Moro Islamic Liberation Front (MILF) and the government to end nearly 50 years of conflict that has killed more than 120,000 people and displaced two million.

It outlines the process to set up a self-administered territory in an area sometimes referred to as Bangsamoro (nation of Moros), encompassing mountains, islands and jungles that is home to at least four million people, mostly Muslim.

President Rodrigo Duterte, who was the mayor of a city on the southern island for 22 years, has stressed the importance of getting the legislation passed and certified it as an urgent bill on Tuesday to get it approved before a house recess on June 2.

The 22-member Senate has committed to Duterte to pass its counterpart version soon, before a panel of both houses combines both drafts in a version for the president’s final approval.

The previous administration met numerous hurdles and failed to pass the bill, fuelling resentment and mistrust among many minority Muslims.

Duterte has warned that another failure could be disastrous and play into the hands of extremist groups like Daesh, which inspired a militant alliance to seize Marawi City last year for five months. The battle for Marawi was the biggest the Philippines has seen since the Second World War and stoked wider concerns that Daesh had ambitions to turn Mindanao into a base for its operations in Southeast Asia.

Hundreds of people were killed in Marawi, more than 350,000 were displaced and half the city was left in ruins. Martial law is still in force across Mindanao.

Though some militants who fought in Marawi were former MILF members, the group has denounced extremist interpretations of Sharia and has a good relationship with Duterte.

Mindanao, an island the size of South Korea, is the Philippines’ most underdeveloped region, but is home to most of its nickel mines and biggest fruit farms, besides vast tracts of land the government wants to convert into palm oil plantations.

But its notorious clan wars, lawlessness and conflicts with Muslim and communist rebel groups have kept investors at bay.

Once signed into law, Bangsamoro will have its own executive, legislature and fiscal powers, but the central government will continue to oversee defence, security, foreign affairs, and monetary policy.