The military said it had dropped bombs on residential neighbourhoods as intense gunfighting could be heard constantly throughout the day.
An initial rampage by gunmen, who have pledged allegiance to the Islamic State group, through the mainly Muslim city of Marawi on Tuesday prompted President Rodrigo Duterte to impose martial law across the southern third of the Philippines.
Authorities said ending the crisis was proving extremely hard because, although there were only 30 to 40 remaining gunmen, the militants were moving nimbly through homes, had planted bombs in the streets and were holding hostages.
Intense gunfighting could be heard constantly throughout the day, according to an AFP reporter in the city, and the military said it had dropped bombs on residential neighbourhoods.
"We are using surgical airstrikes," local military spokesman Lieutenant Colonel Jo-Ar Herrera told reporters in Marawi shortly before big clouds of black smoke rose from a bombed area near the provincial government building.
Most of Marawi's 200,000 residents had fled the city, which is about 800 kilometres (500 miles) south of Manila, but Herrera said those who remained had been warned to get out of the areas where there was bombing and fighting.
"We are requesting our people in Marawi to go to safe places... and to stay indoors," he said.
Five soldiers, two policemen and 26 militants have died in the three days of fighting, according to authorities. Thirty-nine soldiers have been wounded, the military said.
Herrera said two civilians had also been killed inside a hospital that the gunmen had occupied on Tuesday, and the military was investigating reports that nine people had been murdered at a checkpoint the militants had set up.
Local GMA television network showed images of nine bullet-riddled bodies lying in a field with their hands tied together.
Duterte said on Wednesday that one of the policemen killed was similarly caught at a checkpoint set up by the militants, then beheaded.
The militants are also holding between 12 and 15 Catholic hostages abducted from a church, according to the local bishop, Edwin Dela Pena.
The fighting erupted on Tuesday after security forces raided a house where they believed Isnilon Hapilon, a leader of the infamous Abu Sayyaf kidnap-for-ransom gang and Philippine head of IS, was hiding.
The United States regards Hapilon as one of the world's most dangerous terrorists, offering a bounty of $5 million for his capture.
The raid went spectacularly wrong as dozens of gunmen emerged to repel the security forces, then went on a rampage across the city while flying black IS flags.
The gunmen belonged to the Maute group, which along with Hapilon's faction of the Abu Sayyaf, had pledged allegiance to IS, authorities said.
The militants raided two jails, leading to the escape of more than 100 inmates, according to Mujiv Hataman, the governor of a Muslim self-rule area that includes Marawi.
They also set fire to many buildings, including a church and a university.
An enraged Duterte, who was in Moscow to meet Russian President Vladimir Putin, declared martial law shortly after the fighting erupted and cut short his trip to fly home and deal with the crisis.
"It is brutality, cruelty," Duterte said on Wednesday after flying back to Manila.
Duterte said martial law was required throughout the southern region of Mindanao, home to 20 million people, to stop the rising threat of hardline militants aligned to IS.
Muslim rebels have been fighting since the 1970s for an independent or autonomous homeland in Mindanao, with the conflict claiming more than 120,000 lives.
The main Muslim rebel groups are now involved in peace talks with the government.
But the Abu Sayyaf, Maute and other hardline groups want to set up an Islamic caliphate in the south for IS, according to Duterte and security analysts.
Duterte said Wednesday he may impose martial law throughout the rest of the country if he believed the terrorism threat was spreading.
The president, who has waged a controversial war on drugs that has claimed thousands of lives, warned martial law would be "harsh" and similar to military rule imposed by dictator Ferdinand Marcos a generation ago.