An Indonesian man, who reportedly played a role in the 2016 attacks in Jakarta, has been arrested near the southern Philippine city of Marawi, where fighters loyal to ISIL fought with the military for five months.

Muhammad Ilham Syaputra was caught on Wednesday while trying to escape from a district in Marawi, where several fighters of the Maute group are in hiding, according to police.

Syaputra reportedly attempted to evade authorities by swimming across Lake Lanao to a town adjacent to Marawi.

{articleGUID}

His "foreign" appearance raised suspicion among residents who reported him to police.

John Guyguyon, chief of police in Lanao del Sur, where Marawi is located, said Syaputra told investigators he is from northern Sumatra in Indonesia, and he came to the Philippines as early as November 2016 to take part in the planned Marawi siege.

Police seized from the suspect a .45 calibre handgun, some Indonesian passports, different currencies and jewellery.

During the interrogation, Syaputra also reportedly claimed to have played a role in the 2016 attacks in Jakarta's central business district, which left seven people dead, including attackers.

Syaputra was reportedly among the dozens of foreign fighters from neighbouring Malaysia and Indonesia, as well as from Arab countries, who came to Marawi to join the fight. The number of fighters, however, remains unclear.

In recent weeks, police also killed the suspected "financier" of the siege, Mahmud Ahmad, a doctor and a Malaysian national.

Guyguyon said the arrest is a "big blow" to the ISIL-linked fighters, even though he warned others could still launch retaliatory attacks.

'Collective effort'

In a statement, Zia Alonto Adiong, governor of Lanao del Sur, also praised police and residents for the arrest.

"The arrest of Indonesian national involved in the siege of Marawi in the morning of November 1 ... validates the position that civilian participation is essential in our collective effort to secure our communities from terrorist elements," Adiong said.

The siege of Marawi began on May 23 when security forces tried to serve an arrest warrant against Isnilon Hapilon, the leader of the Abu Sayyaf armed group, and a self-proclaimed leader of Islamic State of Iraq and the Levant in Southeast Asia.

Instead of giving up their arms, Hapilon and his fighters formed an alliance with the local Maute Group - led by Omarkhayam Maute and his brothers - and took over the city by Lake Lanao.

An Al Jazeera 101 East investigation also revealed the fighters had planned the siege for more than a year.

More than 1,000 combatants, including foreign fighters, as well as civilians were killed in the fighting, which also displaced as many as 600,000 people in and around Marawi.

On October 23, President Rodrigo Duterte declared the fighting over following the death of Hapilon and Omarkhayam.

Hapilon had a $5m bounty on his head issued by the US government. The government of the Philippines has also offered $200,000 for his capture, and a separate $100,000 for Omarkhayam.

The other Maute brothers have either been killed or arrested, while their parents have also been detained and charged with aiding the fighters.

While the fighting is now over, analysts warn the attackers could return with a vengeance.

Residents also complained that bombings targeting the fighters were "overkill", warning the destruction could fuel anti-government sentiment among displaced locals.