DEIR AL-ZOR, Syria- Remaining civilians are expected to be evacuated from Islamic State's final enclave in eastern Syria on Thursday, U.S.-backed forces said, clearing the way for them to wipe out the last vestige of jihadist rule that once straddled Syria and Iraq.

Iraqi sources said the Syrian Democratic Forces (SDF), which has besieged the last IS enclave near the Iraqi border, handed over more then 150 Iraqi and other foreign jihadists to Iraq on Thursday, under a deal involving a total of 502.

The village of Baghouz at the Iraqi border is the last scrap of territory left to Islamic State in the Euphrates valley region that became its final populated stronghold in Iraq and Syria after a series of defeats in 2017.

Taking it will nudge the eight-year-old Syrian war towards a new phase, with U.S. President Donald Trump's pledge to withdraw troops leaving a security vacuum that other powers are seeking to fill.

Though the fall of Baghouz marks a milestone in the campaign against IS and the wider conflict in Syria, Islamic State is still seen as a major security threat.

The group has steadily turned to guerrilla warfare and still holds territory in a remote, sparsely populated area west of the Euphrates River - a part of Syria otherwise controlled by the Syrian government and its Russian and Iranian allies.

The head of the SDF media office, Mustafa Bali, told Reuters the SDF would attack Baghouz once the civilian evacuation was complete - a process he expected to be finished on Thursday.

Bali did not say how much more time was needed to finish off the remaining Islamic State militants, or give a new estimate of how many fighters remained.

The SDF has previously estimated several hundred fighters - believed mostly to be foreign jihadists - are still inside.

The U.S.-led coalition said on Wednesday "the most hardened" jihadists remain in Baghouz.

More than 2,000 civilians left the enclave on Wednesday, the SDF said. It has said more than 20,000 civilians left Baghouz in the days leading up to the start of the SDF's final push to capture the enclave this month.

Balis said on Wednesday the SDF could not be certain if some Islamic State fighters had left Baghouz with the civilians.

SDF and coalition forces are recording the names and questioning everyone who has left in the civilian convoys.

Many of the people who left the enclave in civilian convoys have been Iraqis, some of whom said they had crossed from Iraq into Syria as Iraqi government forces made gains against Islamic State on the other side of the frontier.

Two Iraqi military sources told Reuters the handover of Islamic State fighters on Thursday was the first of several.

"The majority of the fighters are Iraqi," said a military colonel whose unit is stationed at the Syrian border. "But we have a few foreigners."

The mayor of Iraqi border town Al-Qaim, Ahmed al-Mahallawi, said some fighters' families were also transferred.

"Early this morning, 10 trucks loaded with Daesh fighters and their families were handed over by SDF forces to the Iraqi army," he said, using the Arabic acronym for Islamic State.

"The majority of them are Iraqis and the convoy was under maximum security protection headed to the Jazeera and Badiya military headquarters." Both bases are located in Anbar province.

(Additional reporting by Ahmed Rasheed in Baghdad, Raya Jalabi in Erbil, Tom Perry in Beirut; Writing by Tom Perry, Editing by Angus MacSwan) ((thomas.perry@thomsonreuters.com; Reuters Messaging: thomas.perry.reuters.com@reuters.net))