“We are going to deport him for being an illegal entrant as he has no record of arrival, after he was arrested and deported in 2003 for being an undesirable alien,” Mr. Morente said.

Image Pictured during an earlier arrest in the Philippines in 2003, Mahmoud Afif Abdeljalil, center, was once considered a financier for Al Qaeda. Credit... Joel Nito/Agence France-Presse — Getty Images

In 2003, the authorities in the Philippines said that Mr. Abdeljalil was a close associate of Mohammed Khalifa, a Saudi businessman and bin Laden’s brother-in-law, and that the two were involved in financing the Qaeda network through charity organizations.

The authorities said they began months of monitoring Mr. Abdeljalil after he and an Algerian companion were flagged at a military checkpoint in Zamboanga in August last year. Mr. Abdeljalil said under questioning that he had returned to the country in 2007.

The C.I.A. has drastically weakened Al Qaeda after the Sept. 11 attacks; the organization has not carried out a large-scale attack in years. American officials revealed on Wednesday that Hamza bin Laden, a son of Osama bin Laden who was seen as a future Al Qaeda leader, was killed sometime in the first two years of the Trump administration.

But the Islamic State has risen in the Philippines, even as its presence decreases in the Middle East. It has especially gained a foothold in Mindanao, where the dense wilderness and weak policing have made it a haven for jihadists.