MARAWI CITY, Philippines (Reuters) - With vehicles crushed and overturned and buildings reduced to skeletons of mangled steel and rubble, the Philippine city of Marawi resembles the aftermath of a war that lasted years, rather than months.

Government soldiers wave during a send-off ceremony ending their combat duty against pro-Islamic State groups outside military headquarters in Marawi city, Philippines October 25, 2017. REUTERS/Romeo Ranoco

Except for small clusters of troops dotted amid the ruins and skinny cats and dogs scavenging for food, the heart of Marawi is a ghost town, all but destroyed by the Philippines’ biggest and fiercest urban battle in recent history.

Hundreds of rebels claiming allegiance to Islamic State seized large areas of the city of 200,000 people in May and clung on through unrelenting government air strikes and artillery bombardments, right until the last remaining gunmen were killed three days ago.

The military escorted media on Wednesday through the ravaged streets of the once picturesque lakeside town, showing for the first time the front lines of a devastating conflict that has stoked fears of Islamic State’s extremist agenda taking root in the region.

The scale of the damage was stark as a convoy of vans carrying reporters and cameramen followed an army truck through one district after another, stopping off at key intersections recently cleared of unexploded munitions and booby traps.

Wide boulevards in the city were lined by crumbling homes and shop fronts missing higher floors, with fragments of chairs, children’s toys and household appliances wedged into piles of crumbled concrete.

Tattered pieces of clothing poking above banks of rubble provided the only color in the mass of gutted grey buildings blackened by smoke. Vans, pickup trucks and cars were turned over, coated in rust or torn apart by bomb blasts.

The militants’ planning, stockpiling of weapons and their combat capability stunned government forces, who had to fight street by street to take back the city and were often pinned down by snipers and homemade bombs.

“At first our forces cannot press them, they moved from one building to the next. Our concept was to restrict them - it took time, but we constricted them,” said Lieutenant Colonel Sam Yunque, a special forces commander deployed in Marawi since the beginning of the conflict.

Slideshow ( 10 images )

“We innovated to suppress their techniques. They were not better than us, that’s why they lost.”

RUINS OF WAR

The Philippines announced the end of combat operations in Marawi City on Monday after troops killed 42 remaining militants, including some foreign fighters. More than 1,100 people, including 165 troops and 45 civilians, died in the conflict. The government has said the rest were militants.

Senior officers said they took pains to protect the multitude of mosques in what is the only designated Islamic City in the mainly Catholic Philippines. Although many escaped the pounding of daily air strikes, domes and walls were peppered with holes from heavy machine gun fire as troops sought to flush out rebels hiding within.

Earlier on Wednesday, U.S. Defense Secretary Jim Mattis praised Filipino soldiers for defeating the militants without attracting allegations of human rights violations.

The United States provided critical tactical intelligence in the Marawi combat operation, deploying surveillance planes and drones, thermal imaging and eavesdropping equipment.

The walls were blasted away at Marawi’s police headquarters where the armory was looted, and in the adjacent jail where more than 100 prisoners were freed.

Close by, a mosque minaret had fallen into a mash of metal and rock. Behind it was a lone, leafless tree with only a few branches left.

The militants smashed through thick layers of concrete to turn drainage channels into trenches, doubling as tunnels for fighters to move between buildings and elude surveillance drones and army snipers.

Rebel-held buildings were covered with graffiti, including one of an arrow through a heart, with the message “I love ISIS”, an acronym for Islamic State.

But there was no love for the rebel alliance among the hundreds of jubilant soldiers at send-off ceremonies held this week as troops gradually return home.

Colonel Corleto Vinluan, the commander of joint special operations, described the enemy as “rats”.

He said the military had gained valuable experience in urban combat and chose a strategy that took time, but ultimately paid off.

“We couldn’t just enter the area, it was very big, we did not know where the leaders were, we had to surround them and the area became smaller. It was that time when we really took control,” Vinluan told Reuters.

“We didn’t expect they’ll last that long, their ammunition their firearms and their food. We learned a lot from this event, we adjusted our strategies.

“They were tough fighters, some of them, but not all.”