The U.S.-led coalition and local officials said on Saturday that Syrian Islamic State fighters and civilians will be allowed to evacuate Syria's Raqqa, in a deal that signals the imminent capture of the city but flouts earlier U.S. protests of negotiating safe exits for the extremist group.

Foreign fighters will be excluded from the evacuation deal, the coalition said.

The Syrian military also announced that its forces and allied fighters have seized the town of Mayadeen, an Islamic State stronghold in the country's east.

With the fall of Mayadeen and retaking of Raqqa, Islamic State fighters are losing two of their last strongholds in Syria as their self-declared caliphate crumbles. The militants are currently besieged in the city of Deir el-Zour, leaving them with one last major urban bastion, the strategic town of Boukamal, on the border with Syria and Iraq.

Over the past months, Mayadeen had become a refuge for Islamic State's leadership as they faced an intense crackdown in Syria and Iraq.

Keep updated: Sign up to our newsletter

Email*

Please enter a valid email address

Please wait…

Thank you for signing up.

Oops. Something went wrong.

Thank you,

Mayadeen, on the western bank of the Euphrates River, was also a major node in the race for control of the oil-rich eastern Deir el-Zour province that straddles the border with Iraq. Washington fears advances by Syrian troops and allied fighters could help Iran expand its influence across the region and establish a "Shi'ite corridor" of land links from Iraq to Lebanon, and all the way to Israel. Iran backs militias fighting alongside the Syrian military.

A frame grab shows a Syrian woman with her child after she fled from the areas that still controlled by Islamic State, Raqqa, Syria, October 13, 2017.Uncredited/AP

Diverting fighters from the battle for Raqqa, the U.S.-backed Syrian Democratic Forces made a bid for the province to secure territories there, focusing on securing the Iraq border, still mostly controlled by Islamic State.

The Syrian government eyed Mayadeen earlier this month, fearing the SDF would get there first. The race accelerated amid fear of potential confrontations as Syrian army troops crossed the Euphrates river to reach the oil-rich eastern banks.

On Saturday, an unnamed Syrian military official said Islamic State's defenses in Mayadeen collapsed. Quoted on the pro-government al-Ikhbariya TV, the official said troops were chasing the remaining fighters out of the town while engineers were clearing land mines.

Rami Abdurrahman, the head of the Syrian Observatory for Human Rights confirmed that government troops, backed by Shi'ite militias, had taken control of Mayadeen but were still combing it for militants.

Meanwhile, the U.S.-backed Kurdish-led SDF said the final battle for Raqqa was underway, apparently propelled by negotiation efforts that secured the surrender and evacuation of scores of Syrian militants still holed up in the city.

In a statement, the U.S.-led coalition said a convoy of vehicles is set to leave Raqqa following the deal brokered by the local council formed by the Kurdish allies and Arab tribal leaders.

Reports emerged earlier this week of discussions by the tribal leaders to secure safe passage for civilians, estimated to be around 4,000 last week. The Observatory said the talks were bogged down over the fate of the foreign fighters there, which according to a local Kurdish commander include French, Russian, Azeri, Indonesian and Turkish combatants.

The coalition said it "was not involved in the discussions that led to the arrangement, but believes it will save innocent lives and allow Syrian Democratic Forces and the Coalition to focus on defeating Daesh terrorists in Raqqah with less risk of civilian casualties." Daesh is an Arabic acronym for Islamic State.

The evacuation deal places the U.S. in a bind as it had earlier said that only surrender, not a negotiated withdrawal for Islamic State fighters in Raqqa, would be accepted. The top U.S. envoy for the anti-Islamic State coalition, Brett McGurk, had previously stated that foreign fighters in Raqqa will die in the city.

Only weeks ago, the U.S. coalition obstructed a Hezbollah-negotiated deal to evacuate Islamic State fighters from its borders with Syria toward the border with Iraq. The coalition bombed the road used by the convoy evacuating the militants, only to finally capitulate following Russian calls asking it to allow Syrian troops in the area to advance.

It is also not clear what kind of justice would be meted out to militants in the absence of established courts in Kurdish-dominated northern Syria.

The local Kurdish commander said preparations are under way to evacuate the local Syrian fighters who were called upon to surrender as the talks went on. The commander said the foreign fighters were unlikely to surrender so his forces are expecting to "comb them out" of at least two neighborhoods. He said it could be a matter of a day or two.

Omar Alloush, a senior member of the Raqqa Civil Council, told The Associated Press that Arab fighters and civilians will be evacuated but didn't specific a number. He said a day earlier that about 100 Islamic State militants had surrendered at once.

A local council said a senior tribal leader who will remain unidentified was put in charge of negotiating with Islamic State. Both the commander and the Arab official spoke on condition of anonymity because he was not authorized to disclose details of the negotiations.

Scores of civilians were seen in a video Friday leaving Raqqa in desperate and terrified conditions. They emerged from destroyed districts, some of them collapsing on the ground in exhaustion as they arrived at a Kurdish-held area of the city, in haunting scenes reflecting their years-long ordeals.

Spokesman for the SDF Mustafa Bali said the militants were putting up a desperate fight in a few remaining neighborhoods in Raqqa, calling it "the final battle" for the city.

The U.S.-led coalition said it expects "difficult fighting" in the days ahead to completely oust IS from the city and secure it. SDF and U.S. officials said the remaining militants are mostly suicide bombers who only have small arms and rifles. Backed into a small area, they have no access to their weapon of choice, car bombs, said Mustafa Bali, an SDF spokesman.

Militants seized Raqqa in 2014, the first city to fall under the full control of the extremist group, and declared it the caliphate of their self-styled caliphate. It became synonymous with Islamic State's reign of terror, with public killings and beheadings — videotaped slayings that have shocked the world. It was also from Raqqa, which became a destination for foreign fighters from around the world, that many of Islamic State's attacks in the West were plotted.

The latest battle for Raqqa began in June, with heavy street-by-street fighting amid intense U.S.-led coalition airstrikes and shelling. The battle has dragged on in the face of stiff resistance from the militants.

Haaretz.com, the online edition of Haaretz Newspaper in Israel, and analysis from Israel and the Middle East. Haaretz.com provides extensive and in-depth coverage of Israel, the Jewish World and the Middle East, including defense, diplomacy, the Arab-Israeli conflict, the peace process, Israeli politics, Jerusalem affairs, international relations, Iran, Iraq, Syria, Lebanon, the Palestinian Authority, the West Bank and the Gaza Strip, the Israeli business world and Jewish life in Israel and the Diaspora.