Seven military bodyguards of President Rodrigo Duterte and two other soldiers were wounded Tuesday in an ambush by suspected Islamic militants on the eve of his planned visit to the southern Philippines, the military and president said.

Military spokesmen said a bomb hit the soldiers' convoy as it drove on a road in a southern region where an armed group which had pledged allegiance to the Islamic State (IS) group operated, wounding nine.

"My advance party was ambushed a while ago. The Presidential Security Group was hit by an IED (improvised explosive device)," Duterte said in a speech during a visit to a northern Philippines military camp.

"But I'm going there. The advice was to postpone it (the trip), but I said no. We are taking the same route if possible," Duterte added without explaining the purpose of his trip.

The convoy that was attacked in Marawi city also included local troops as well as staff members of the presidential communications office, though no civilians were hurt, military officials said.

The planned Duterte visit came days after the military began operations against dozens of armed members of the Maute group holed up in an abandoned government building in the mainly Muslim rural town of Butig on Mindanao island.

Butig is about 800 kilometres (500 miles) south of Manila, and an hour-long drive from Marawi.

Fifteen soldiers were injured in the fighting while 35 militants were killed, military spokesman Brigadier-General Restituto Padilla told AFP.

The ambush came a day after the police said the Maute group left a bomb near the US embassy in Manila which authorities later safely exploded.

The Maute gang was also blamed for a bombing in Duterte's home town in the southern city of Davao in September that killed 15 people.

Padilla said it was likely the Maute group was behind Tuesday's ambush.

"We know their supporters are surrounding the area and possibly planted bombs on the side of the roads to disrupt the movement of troop reinforcements," Padilla said.

Muslim groups have waged a decades-long armed independence struggle in the south of the mainly Catholic Philippines that is believed to have claimed more than 120,000 lives.

On Monday, Duterte said IS, which controlled vast swathes of Iraq and Syria, had linked up with the Maute gang, a departure from previous military denials of formal links between IS and local extremist groups.