Philippine president Rodrigo Duterte has ordered troops to "crush" Islamic extremists who have occupied parts of a southern city for more than two weeks, despite they are holding dozens of civilian hostages and hundreds of residents remain trapped.

"When I say crush them, you have to destroy everything including lives. Rebellion is no joking matter," the firebrand president told reporters.

"I cannot stop my soldiers now…let's finish this war that you (Islamic State) have started."

Since hundreds of militants seized Marawi, a city of 200,000 people on May 23, the military has used precision assaults, backed by aerial and artillery bombardment, to attack the militants.