CLARK, Philippines (AP) — The Islamic State group sent at least $1.5 million to finance the recently ended siege of the southern Philippine city of Marawi, with the assault leaders using the 2014 IS seizure of the Iraqi city of Mosul as a blueprint, the Philippine military chief said.

The battle defeats of the brutal group in Syria and Iraq, and now the IS-aligned gunmen in Marawi, however, show a major vulnerability of the extremists: Their audacious territorial occupations tend to crumble over time as they're cornered in urban settings by the relentless firepower of U.S.-backed offensives, Gen. Eduardo Ano said in an interview with The Associated Press late Monday.

The counterterrorism victories have given governments confidence that IS — which shocked the world with its rise a few years ago — could be stopped and defeated, said Ano, who oversaw the military campaign that ended the five-month siege in Marawi this week.

"They underestimated the reaction of the different countries in the world, the alliances," he said.

"With what happened in Mosul, the Philippines and Raqqa, the different countries are now confident that if ever an ISIS siege would erupt ... they now have the recipe or the formula to fight it," Ano said, adding that the Philippine military is ready to share its battle experiences in mosque-studded Marawi.

The siege, which was launched on May 23, left more than 1,100 combatants and civilians dead, including more than 900 militants, and displaced some 400,000 residents, including the entire population of Marawi, a bastion of the Islamic faith in the predominantly Roman Catholic Philippines. Military airstrikes, artillery and heavy machine-gun fire turned the lakeside city's central business district and outlying communities into a smoldering wasteland of disfigured buildings and bullet-pocked mosques and houses.

It was one of the most devastating urban fights the country has witnessed since World War II, the military chief said.

Like in Mosul, the black-flag waving militants plotted to launch the Marawi siege on the first day of Ramadan, the holy Muslim month of fasting, but they were forced to stage the attack prematurely after Philippine army troops raided the hideout of its leaders. They also took hundreds of hostages as human shields and employed snipers to slow the advance of the military, Ano said.

"Every day, they watched videos of ISIS in Mosul," Ano said of the Marawi siege leaders, including Isnilon Hapilon, a top Asian terror suspect who was killed by Filipino troops last week.

"That was their blueprint, that was their pattern," he said, adding that troops recovered Islamic State group video discs of the Mosul violence in captured militant positions in Marawi.

It took about three weeks for thousands of government forces, which have been battling insurgents in jungle settings, to adopt to the urban fighting, Ano said. Two battalions of marines, for example, got stuck in a beach until a combat engineering battalion was quickly organized to clear mounds of debris that allowed them to move inland.

The massive offensive led to the killings of at least 10 key terror suspects from different extremist groups that have pledged allegiance to the IS, including Hapilon, four siblings belonging to the local Maute clan, and Indonesian and Malaysian militants, he said.

It would have taken five to 10 years for troops to hunt down and find all those militant leaders in the jungles of the south, where Ano said the extremists had mastery of the terrain and support from local clans.

The leaders of the bloody insurrection, who came from different ethnic backgrounds, were linked by their desire to be recognized by IS as its Southeast Asian branch and obtain funding from the Middle East-based group.

When the militants forged an alliance, IS sent $1.5 million in batches to finance the attack, Ano said, citing intelligence information, including some provided by the U.S.

But Ano said the Marawi militants, like their Middle East counterparts, were blindsided by their ambition and miscalculated the response to their plot, which involved the seizure of a military camp in Marawi.

"They thought that they can get the helicopters and armored vehicles and the people of Marawi will protect them, and there will be a flag flying and they can all it their own, an enclave, and probably more foreign fighters will come," Ano said.

Tens of thousands of Marawi residents, however, abandoned the city in panic and troops managed to secure Marawi's military camp and other vital areas. The United States and Australia later deployed surveillance aircraft that provided real-time images of militant positions, even at night — modern warfare technology that, coupled with the tenacity of Filipino troops, became a "game changer" in the massive effort to liberate the city, Ano said.

The military firepower was designed to push the militants to a coastal area where they could be overcome more easily, said the veteran combat general, who called the Marawi offensive the greatest battle of his military career. He retires on Thursday.

"We designed a very good campaign to flush them out and pressure them and canalize them into the chosen engagement areas," he said. "We call it constriction."