Philippine President Rodrigo Duterte has vowed to deal with militants harshly and warned that the martial law imposed by him on the island of Mindanao on Tuesday (23 May) could remain in force for a year.

Duterte declared martial law while he was on an official visit to Russia, where he met President Vladimir Putin. The move was triggered by recent fierce clashes in Marawi city between the army and an Islamist militant group that has reportedly pledged allegiance to Isis.

The Maute group took control of buildings in Marawi – about 800km from capital Manila – and set fire to a school, a church and a detention facility on Tuesday.

The situation forced Duterte to cut short his visit and head back to the country on Wednesday to deal with the situation.

"Martial law is martial law. My countrymen have experienced martial law. It would not be any different from what president Marcos did. I'd be harsh," Duterte said on Wednesday, referring to the 1970s martial law imposed by late dictator Ferdinand Marcos.

"If it would take a year to do it then we'll do it. If it's over with a month, then I'd be happy," the president, known for his bloody war on drugs, said during a live interview while he was flying back to Manila.

He added: "To my countrymen, do not be too scared. I'm going home. I will deal with the problem once I arrive."

Philippines President Rodrigo Duterte
Philippines President Rodrigo Duterte said the martial law will be as harsh as late president Ferdinand Marcos's in the 1970s Reuters

The Philippines army said they were optimistic that their fight with the militants – Maute group and Abu Sayyaf – would end sooner rather than later. "The intent of these security forces, the armed forces of the Philippines, is to conclude this rapidly so that we can restore normalcy in that area," military spokesperson Edgar Arevalo said in an interview with news channel ANC.

Arevalo added that there was no Isis presence in the country and the local extremists were merely using the name to their benefit.

"This so-called group who are posing to be Isis, they are merely courting the acclamation of Isis which until now they haven't received, that's why they continue with their atrocities."

Meanwhile, on Wednesday, the military succeeded in rescuing nearly 42 teachers who were trapped inside a building after the Maute group attack on Marawi city, ABS-CBS news reported. The teachers were attending a training programme when a firefight between soldiers and terrorists began.

A male teacher told the news channel that the militants surrounded the building and tried to break in to take hostages, while the teachers kept hiding "like rats" to prevent arrest.

"We were running to and fro hiding, we were like rats hiding in a burrow. We went upstairs and downstairs several times that we lost count. Some teachers even fell down," the person said.