MANILA (Reuters) - Fighting between government-backed separatist rebels and pro-Islamic State militants have killed at least 25 people in the southern Philippines, the army said on Monday, as the military battles to restore order on the troubled island of Mindanao.

Soldiers provided artillery support for the Moro Islamic Liberation Front (MILF), a Muslim rebel group with which the government has signed a peace agreement, to try to tackle Islamist extremists, spokesman Colonel Gerry Besana said.

The MILF and the government have agreed to work together to thwart several militant groups in Mindanao that have pledged allegiance to Islamic State.

The island of 22 million people and roughly the size of South Korea is under martial law at least until the end of the year, as President Rodrigo Duterte tries to extinguish a growing threat of radical Islam taking a hold and turning the southern Philippines into a magnet for foreign extremists.

For a graphic on pro Islamic State groups in Philippine south, click

The MILF is opposed to radical groups and sees them as undermining its legitimate quest for greater autonomy for Muslims in parts of Mindanao, to end nearly 50 years of conflict that has killed more than 120,000 people and displaced 2 million.

“Based on reports from ceasefire monitors, the two sides suffered 25 casualties, including 20 from the ISIS-inspired group,” Besana said, referring to Islamic State by another acronym.

He said 10 MILF were wounded and were being treated at a military hospital.

The conflict started on Aug 7 when extremists from Bangsamoro Islamic Freedom Fighters (BIFF) attacked two villages in Maguindanao and their homemade bombs killed five MILF fighters.

The MILF responded and clashes lasted six days, with the military firing howitzer cannons in support, Besana said.

The government and MILF have agreed on a Bangsamoro Basic Law, which needs legislative approval, to create an autonomous region for the Moro minority in the Philippines with its own executive, legislature and fiscal powers.

The BIFF is a breakaway faction of the MILF that disagrees with the peace process and wants an independent Islamic State in the south.

The military is concerned about the possibility that the BIFF, though smaller and less organized, could join forces with larger, more powerful militant group, Dawla Islamiya, better known as the Maute group.

The Maute group, with the support of armed elements of another group, Abu Sayyaf, has held the commercial heart of Marawi City through more than 80 days of clashes and air strikes by the military that have left 700 people dead and displaced some 600,000.

Army officials on Monday estimated about 20-40 militants were holed up in Marawi and believed to be holding scores of hostages as human shields, complicating efforts for a military aided by American technical support to retake the city.

The rebels were running out of options and could strap explosives on hostages and detonate if soldiers encircled their positions, the military said. There is no known precedent for suicide bombings in the Philippines.