US-backed forces are on the verge of driving ISIS out of its stronghold and de facto capital in the northern Syria city of Raqqa, military spokesmen said Saturday.

Some ISIS fighters were going to be allowed to escape Raqqa Saturday night as part of a convoy that was to evacuate 400 civilians from the battered city in a deal brokered by local tribal chiefs and Kurdish allies of the US, officials said.

The convoy was to transport civilians held at the city’s National Hospital, said Reuters.

Other civilians hoping to leave emerged from buildings after living for years under desperate conditions.

Those civilians are fleeing what looks to be the final battle over the city, which has been in ISIS possession since 2014.

The US-led coalition now surrounding Raqqa expects difficult fighting in the days ahead as it completely ousts ISIS, said Col. Ryan Dillon, a coalition spokesman.

The remaining militants are mostly suicide bombers who only have small arms and rifles.

The latest battle began in June, with heavy street-by-street fighting amid intense US-led coalition airstrikes and shelling.

The battle has dragged on in the face of stiff resistance, though scores of ISIS fighters have surrendered in recent days.

As Raqqa appears ready to fall, the Syrian military took control of Mayadeen, another ISIS stronghold in the country’s east.

ISIS is also besieged in the city of Deir el-Zour. The group has one last major urban bastion, the town of Al Bukamal, near Syria’s border with Iraq.

ISIS lost Mosul, its last major stronghold in Iraq, in July.

The deal allowing for passage for Syrian ISIS militants from Raqqa on Saturday excluded foreign fighters, which include French, Russian, Azeri, Indonesian and Turkish combatants.

With Post wires