MARAWI CITY, Philippines (Reuters) - Prayer mats, chequered scarves, black fatigues, and bullet-ridden walls mark the hideout where the “emir” of Islamic State in Southeast Asia spent months preparing the most brazen and devastating militant attack in the region.

A four-storey house in a quiet alley of Marawi City in the southern Philippines was the secret lair of Isnilon Hapilon until late May. After a botched military raid to apprehend him, a thousand-strong rebel alliance held large parts of the city for five months.

Hapilon’s death in a military operation elsewhere in Marawi on Oct. 16 was the catalyst for the end of Philippines’ longest and most intense urban battle in recent history.

Security forces moved in on the house on May 23, trying to capture the country’s most wanted man, but came under sustained attack from rebels firing rocket-propelled grenades.

A bomb-battered structure, shattered windows and wall-to-wall holes from machine gun fire tell the story of the ferociousthree-day battle that erupted at Hapilon’s hideout, and promptedthe call to hundreds of fighters to expedite the plannedtakeover of Marawi.

Hapilon escaped through a large hole that was blasted out of a rear wall, making his way across a rice field to a mosque next to the vast Lake Lanao. From there, he joined the guerrillas.

Community volunteers on Thursday showed Reuters the house in the now empty, narrow street where the military believes Hapilon had lain low for several months. All other properties were intact and neighbors had fled long ago.

“At the time, no one knew who these people were. People saw them about but there was no reason to suspect anything,” said Mohammed Seddick Raki, who lived nearby.

Other volunteers said women and children stayed at the rented house and visitors were frequent.

Slideshow ( 10 images )

Children’s shoes were scattered amid the debris and a woman’s robe was hanging from a window.

BATTLE READY

Inside the house, black shirts, pants and plaid scarves synonymous with Islamic State were strewn across rooms littered with broken floor tiles and chunks of rock from blasted walls.

Left behind were waterproof boots, a balaclava, medical supplies and camouflage bags and waistcoats typically used by soldiers to carry rifle magazines.

Coated in a think layer of dust on floors of every room were pocket-sized copies of the Koran, some with pages stained by water leaked through gaping holes in the roof.

A mosque, about 100 meters behind the house, was the venue for an annual gathering in Marawi of Tablighi Jamaat, a Sunni missionary movement, just days before the fighting erupted.

Military officials say the foreigners who fought in Hapilon’s alliance - among them Indonesians, Malaysians and some from Arab states - had used that event as a cover to slip into Marawi without raising suspicion.

The deputy task force commander in Marawi, Colonel Romeo Brawner, said Hapilon evaded security forces because rebels had a network of lookouts and gunmen ready to defend him.

Slideshow ( 10 images )

“They put up heavy resistance. They were spread across a large area. They were strategically placed,” he said. “They were prepared for it.”

Hapilon’s escape in the last week of May led to anarchy in the city of about 200,000. Rebels took hostages, set fire to buildings, ransacked churches, broke into the local jail to free inmates and looted an armory.

The government had insufficient security forces in Marawi to prevent the fighters from fanning out across the city and seizing hundreds of buildings.

Hapilon was wanted by the U.S. Federal Bureau of Investigation (FBI) and had a bounty on his head of up to $5 million. He was killed by army rangers in a night operation and his body was retrieved from the battle zone in the heart of the city. His identity was confirmed by the FBI’s DNA analysis.

The city of Marawi was all but destroyed by government air strikes and shelling that leveled commercial areas and crushed thousands of shops, homes and vehicles.

“No one could have known what would happen,” said Mohamed Faisal Mama, a resident in the same Basak Malutlot district where Hapilon was hiding.

“No one knew them. They weren’t famous then.”