ILIGAN CITY, Philippines — Islamic State group-linked militants swept through a southern Philippine city, beheading a police chief, burning buildings, seizing a Catholic priest and his worshippers and raising the black flag of the extremist group, authorities said Wednesday. President Rodrigo Duterte, who had declared martial law across the southern third of the nation, warned he may expand it nationwide.

At least 21 people have died in the fighting, officials said.

As details of the attack in Marawi city emerged, fears mounted that the largest Roman Catholic nation in Asia could be falling into a growing list of countries grappling with the spread of influence from the Islamic State group in Syria and Iraq.

The violence erupted Tuesday after the army raided the hideout of Isnilon Hapilon, a commander of the Abu Sayyaf militant group who has pledged allegiance to the Islamic State group. He is on Washington’s list of most-wanted terrorists with a $5 million reward for information leading to his capture.

The militants called for reinforcements and around 100 gunmen entered Marawi, a mostly Muslim city of 200,000 people on the southern island of Mindanao, Defense Secretary Delfin Lorenzana said.

“We are in a state of emergency,” Duterte said Wednesday after he cut short a trip to Moscow and flew back to Manila. “I have a serious problem in Mindanao and the ISIS footprints are everywhere.”

He declared martial rule for 60 days in the entire Mindanao region – home to 22 million people – and vowed to be “harsh.”

“If I think that you should die, you will die,” he said. “If you fight us, you will die. If there is open defiance, you will die. And if it means many people dying, so be it.”

But he said he would not allow abuses and that law-abiding citizens had nothing to fear.

Duterte said a local police chief was stopped at a militant checkpoint and beheaded, and added that he may declare martial law nationwide if he believes the group has taken a foothold.

Marawi Bishop Edwin de la Pena said the militants forced their way into the Marawi Cathedral and seized a Catholic priest, 10 worshippers and three church workers.

The priest, Father Chito, and the others had no role in the conflict, said Archbishop Socrates Villegas, president of the Catholic Bishops Conference of the Philippines.

“He was not a combatant. He was not bearing arms. He was a threat to none,” Villegas said of Chito. “His capture and that of his companions violates every norm of civilized conflict.”