More than 3,000 civilians have fled the Islamic State (IS) group's former Syrian stronghold Raqqa, leaving behind only relatives of foreign IS militants, a US-backed militia attacking the city said Sunday.

"More than 3,000 civilians left on Saturday night as part of a deal and went to areas controlled by the Syrian Democratic Forces," Talal Sello, spokesman for the militia, told AFP.

"Raqqa is now empty of civilians who had been taken as human shields," he said.

"Only 250 to 300 foreign terrorists who refused the deal and decided to stay and fight until the end remains in the city, and relatives of some members are with them," he said, without specifying the number of civilians.

Sello said the deal had been negotiated between local officials from the Raqqa Civil Council and Syrian IS militants still in the city.

He said a total of 275 Syrian IS militants and family members had left IS-held parts of the city and were with SDF fighters.

He declined to specify where those fighters and their families would go.

"A statement on the destination of the fighters who have left under the agreement will be issued," he said.

Local officials had been in talks for days on a deal to protect thousands of civilians and capture the last 10 percent of Raqqa still under IS control.

The SDF, an alliance of Kurdish and Arab fighters, broke into Raqqa in June after months of battle to encircle the city.

Their campaign has been backed by the US-led coalition against IS, which said it had discussed the evacuation deal with local leaders and expressed its opposition to the exit of foreign IS militants.