By John Davison and Tom Perry
AIN ISSA, Syria/BEIRUT (Reuters) - Syrian Islamic State fighters are set to abandon Raqqa in a withdrawal agreed with U.S.-backed Syrian militias that have them surrounded, a militia spokesman said on Saturday, as the jihadists' defeat in their former Syrian capital edged closer.
Officials gave conflicting accounts on whether foreign fighters would also be leaving the city, where the U.S.-backed Syrian Democratic Forces (SDF) have been battling to defeat Islamic State since June.
SDF spokesman Talal Silo said the foreign fighters would be left behind "to surrender or die", without saying when the evacuation of Syrian fighters would take place.
But Omar Alloush, a member of Raqqa's Civil Council, said the evacuation would include foreign fighters. He said it would take place overnight into Sunday. The jihadists would be taking some 400 civilians with them as human shields, he said.
The final defeat of IS at Raqqa would be a milestone in efforts to roll back the theocratic "caliphate" the group declared in 2014 in Syria and Iraq, where earlier this year it was driven from the city of Mosul.
IS used Raqqa as a base to plan attacks against the West.
The Kurdish YPG militia, which dominates the SDF, told Reuters earlier on Saturday that Islamic State was on the verge of defeat in Raqqa, and the city may finally be cleared of the jihadists on Saturday or Sunday.
The U.S.-led coalition against Islamic State said a convoy was due to leave Raqqa on Saturday, in an arrangement agreed by local parties. It described the arrangement as "a civilian evacuation" and said it would not condone any arrangement that allowed "terrorists to escape Raqqa without facing justice".
Coalition spokesman Col. Ryan Dillon said the coalition's stance was that IS fighters must surrender unconditionally, but added that he could not comment on who would be in the convoy. He said difficult fighting was expected in the days ahead.
The coalition statement said the arrangement brokered by the Raqqa Civil Council and local Arab tribal elders on Oct. 12 was "designed to minimize civilian casualties and purportedly excludes foreign Daesh terrorists".
The coalition believed the arrangement would "save innocent lives and allow Syrian Democratic Forces and the coalition to focus on defeating Daesh terrorists in Raqqa with less risk of civilian casualties", it said.
Tribal leaders from Raqqa said the SDF had agreed to allow safe passage out of the city for Syrian Islamic State fighters still inside, and they were organizing a "mechanism" for them to leave.
Its statement made no mention of the fate of Islamic State's foreign jihadists, but said the remaining fighters in the city were only "a small number besieged in one or more positions in the city, who have no choice but surrender or death".
Alloush earlier told Reuters that the IS fighters would go to remaining territory held by the group in Syria.
Negotiated withdrawals of combatants facing defeat have become a common feature of the six-year-long Syrian war.
An activist group that reports on Raqqa, Raqqa Is Being Slaughtered Silently, said on its Facebook page that dozens of buses had entered Raqqa city overnight Friday from the countryside to the north.
The Syrian Observatory for Human Rights, a British-based organization that reports on the war, said Syrian Islamic State fighters and their families had already left the city, and buses had arrived to evacuate remaining foreign fighters and their families.
The Syrian army, which is supported by Iran-backed militias and the Russian air force, declared another significant victory over Islamic State on Saturday, saying it had captured the town of al-Mayadin in Deir al-Zor province.
The eastern province is Islamic State's last major foothold in Syria, and it is under attack there from the SDF on one side and Syrian government forces supported by Iran-backed militias and Russian air strikes on the other.
Islamic State fighters had previously agreed to an evacuation last August, from an area on the Syrian-Lebanese border.
But as their convoy moved toward Islamic State-held territory in eastern Syria, coalition planes blocked its route by cratering roads, destroying bridges and attacking nearby Islamic State vehicles.
(Reporting by Lisa Barrington and Tom Perry in Beirut; Editing by Richard Balmforth)