MANILA, Philippines -- Philippine President Rodrigo Duterte declared the country's south under martial rule for 60 days and cut short a visit to Moscow on Tuesday after Muslim extremists allied with the Islamic State of Iraq and Syria, or ISIS, laid siege to a southern city.

Presidential spokesman Ernesto Abella told a news conference in Moscow that martial rule took effect Tuesday evening in the southern region of Mindanao "on the grounds of existence of rebellion."

Defense Secretary Delfin Lorenzana said troops raided the hideout of a top terrorist suspect in southern Marawi city on Tuesday, sparking a gunbattle that prompted the militants to call for reinforcements from an allied group, the Maute. He said dozens of gunmen occupied city hall, a hospital and a jail and burned a Catholic church, a jail, a college and some houses in a bold attack that killed at least two soldiers and a police officer and wounded 12 others.

Several militants were killed in the fighting in Marawi city in Lanao del Sur province, about 520 miles south of Manila, but others continued to lay siege to the largely Muslim city of more than 200,000 people, officials said, adding that power was cut in the city in a chaotic scene.

Get Breaking News Delivered to Your Inbox

"The whole of Marawi city is blacked out, there is no light, and there are Maute snipers all around," Lorenzana said in the news conference in Moscow, which was broadcast live in the Philippines.

Philippine Foreign Secretary Alan Peter Cayetano said he informed his Russian counterpart, Sergey Lavrov, of Duterte's decision to fly home early to deal with the crisis. Cayetano said he would stay behind in Moscow, where a number of agreements are to be signed between the governments.

Duterte's martial law declaration will help government forces carry out searches and arrests and detain rebel suspects more quickly, Lorenzana said. He said offensives would also be staged in other southern provinces plagued by extremist groups. Despite the moves, he said the government remains in control of the situation in Marawi city and other security trouble spots in the south.

Military chief of staff Gen. Eduardo Ano said the fighting broke out in Marawi when troops attacked a hideout for Muslim extremist leader Isnilon Hapilon.

Hapilon reportedly has been chosen to lead an ISIS branch in Southeast Asia and is on the U.S. Department of Justice list of most-wanted terrorists worldwide, with a reward of up to $5 million for his capture. An Arabic-speaking Islamic preacher known for his expertise in commando assaults, he pledged allegiance to the ISIS group in 2014, according to security officials.

Ano said Hapilon, who is still recovering from wounds sustained in a military airstrike in January, and more than a dozen of his men summoned reinforcements from their allies in the Maute militant group. Ano said nearly 50 gunmen in all managed to enter the city.

One group of about 20 gunmen took position in a hospital, where they raised a black ISIS-style flag at the gate, and 10 other militants went near a provincial jail where troops and policemen engaged them in fighting, he said.

Troops sealed off major entry and exit points to prevent Hapilon from escaping, Ano told The Associated Press by telephone from Moscow, where he was accompanying Duterte.

"They did some burnings, they showed up in another area so it looked chaotic, but it's actually a small group facing an overwhelming number of government forces," Ano said.

"We will conduct house-to-house clearing and do everything to remove the threat there. We can do that easily," Ano said, but added it was more difficult in an urban setting because of the need to avoid civilian casualties.

The Maute group is one of less than a dozen new armed Muslim groups that have pledged allegiance to ISIS and formed a loose alliance in the southern Philippines in recent years. Hapilon was reportedly designated the leader of the alliance.

The Maute has been blamed for a bomb attack that killed 15 people in southern Davao city, Duterte's hometown, last September and a number of attacks on government forces in Lanao, although it has faced setbacks from a series of military offensives.

Last month, troops backed by airstrikes killed dozens of Maute militants and captured their jungle camp near Lanao del Sur's Piagapo town. Troops found homemade bombs, grenades, combat uniforms and passports of suspected Indonesian militants in the camp, the military said.

While pursuing peace talks with two large Muslim rebel groups in the south of the predominantly Roman Catholic nation, Duterte has ordered the military to destroy smaller extremist groups which have tried to align with ISIS.

Duterte had repeatedly threatened to place the south, the scene of decadeslong Muslim uprisings, under martial law if terrorism spiraled out of control. Human rights groups have expressed fears that martial law powers could further embolden Duterte, whom they have accused of allowing extrajudicial killings of thousands of drug suspects in a crackdown on illegal drugs.