Iraq's Prime Minister Adel Abdul Mahdi attends the opening of Baghdad International Fair in Baghdad, Iraq, November 10, 2018. REUTERS/Thaier al-Sudani

CAIRO (Reuters) - Iraqi Prime Minister Adel Abdul Mahdi sought Egypt’s support for efforts to tackle Islamist militants in the region during a visit to Cairo on Saturday, his first trip abroad since taking office in October.

After meeting Egyptian President Abdel Fattah al-Sisi, Abdul Mahdi highlighted “the importance of drying up the sources of terrorism” and said “cooperation between Egypt and Iraq will be essential for this matter,” according to an official statement.

His comments came as U.S.-backed forces said they had captured Islamic State’s last shred of territory in eastern Syria at Baghouz, ending its territorial rule over a self-proclaimed caliphate straddling Syria and Iraq after years of fighting.

Though the defeat ends the group’s grip over the jihadist quasi-state that it declared in 2014, it remains a threat.

Some Islamic State fighters still hold out in Syria’s remote central desert and in Iraqi cities they have slipped into the shadows, staging sudden shootings or kidnappings and awaiting a chance to rise again.

The United States thinks the group’s leader, Abu Bakr al-Baghdadi, is in Iraq.

Defeating militants in Egypt’s Sinai Peninsula and restoring security after years of unrest has been a key promise of Sisi, the general-turned-president who came to power a year after the military overthrew Islamist President Mohammed Mursi in 2013.

Egypt has fought an insurgency waged by an Islamic State affiliate in North Sinai since 2013. Hundreds of members of the security forces have been killed.