MANILA -- Philippine President Rodrigo Duterte on Friday blamed the U.S., his country's main ally and treaty partner, for creating an environment that has encouraged radicals to wreak terror worldwide.

Speaking before a gathering of Muslims in the southern Philippines at the end of Ramadan, the holy month of fasting, Duterte said jihadis are people who have been "driven to desperation."

"There was no sufficient semblance of governance, and that is why they [were] pushed to the wall," the president said of extremists in the Middle East. "Then they became radicalized."

He continued: "It is not that the Middle East is exporting terrorism to America. America imported terrorism."

The president, who is known for courting controversy, made the remarks in the wake of a series of deadly terrorist attacks around the globe.

The Islamic State group claimed responsibility for an attack at an upscale cafe in Dhaka earlier this month, in which 22 people were killed -- 20 of them civilians. Suicide bombers also opened fire and blew themselves up at Istanbul's main international airport on June 28, killing more than 40 people and wounding hundreds more.

On Sunday, a powerful explosion in a crowded commercial area of Baghdad killed more than 200 people, making it one of the deadliest attacks in war-torn Iraq.

Duterte appeared to draw parallels between the grievances of Middle Eastern insurgents and those of the Philippines-based militants he must contend with. Local terrorist group Abu Sayyaf beheaded two Canadian hostages in April and June, after its ransom demands were not met. A Norwegian remains in captivity, while the Filipina girlfriend of one of the Canadians was released last month.

Duterte's remarks could strain Manila's long-standing alliance with Washington, which includes a defense cooperation pact that allows for a renewed American military presence on Philippine soil.