Thousands of displaced residents streamed back into the northern Syrian town of Manbij today after US-backed fighters ousted the last so-called Islamic State militants from their former stronghold, residents and US allies said.

The US-backed Syria Democratic Forces (SDF) announced yesterday they had seized full control of the city near the Turkish border after the departure of the last of the militants, who had been using civilians as human shields.

Hundreds of cars and vehicles carrying families and their belongings flocked into the city from makeshift camps and villages in the countryside, where many of the city's residents took shelter during the two-month campaign, according to an SDF official and relatives who were in contact with residents.

"Thousands are coming back and shops are opening. Today is the first day life is returning to normal," said Sharfan Darwish, spokesman for the SDF-allied Manbij Military Council.

Pro-SDF news sites showed jubilant families who had been trapped in the city during the fighting talking about how harsh life was under IS and its imposition of strict dress codes in public.

Their footage showed men shaving their beards and veiled women setting fire to niqabs they were forced to wear in public that covered their entire face apart from the eyes.

The militants were finally ousted after a deal was reached yesterday that secured their departure together with some 2,000 civilians, believed to have been their relatives, towards their stronghold of Jarablus near the border with Turkey, a Syrian from Manbij who is in touch with relatives there said.

It was not clear whether those leaving were hostages or had left voluntarily, a Kurdish source said.

The SDF, formed last year by recruiting Arabs to join forces with the powerful YPG Kurdish militia, launched an offensive with the support of US-led strikes at the end of May to remove IS from areas it controls along the Turkish border.

Blow to Islamic State

The loss of Manbij, occupied by IS since early 2014, is a big blow to the militants as it is of strategic importance, serving as a conduit for the transit of foreign jihadists and provisions from the Turkish border.

The operation marks the most ambitious advance by a group allied to Washington in Syria since the United States launched its military campaign against IS two years ago.

Mr Darwish attributed the speedy return to life in the city to a military and aerial campaign that he said spared many neighbourhoods where thousands of civilians had remained even at the height of fighting.

Despite intensive US bombing of bridges, several hospitals and a large silo in the course of the campaign, the city appears to have been spared the devastation of other cities in the Syrian conflict.

The SDF, which had already cleared over 13,000 mines, was sweeping some neighbourhoods in search of militant sleeper cells suspected to still be operating.

A former resident of the city said he had reports from family members that the Kurdish YPG, who are the dominant group within the SDF, had rounded up dozens of young men before screening them because of concerns that some of them belonged to sleeper cells.

The capture of Manbij bolsters the position of Kurds who already control an uninterrupted 400km stretch of Syria's northern border with Turkey.

Washington has long lacked capable proxies on the ground, but has found its first strong allies in SDF.

Their gains have alarmed rebel forces battling President Bashar al-Assad, who say they will respond with force to any attempt to break up Syria.

51 civilians killed in Aleppo raids, shelling

At least 51 civilians, including four children, were killed in air raids and shelling attacks in Syria's battleground city Aleppo and the neighbouring countryside, a monitoring group said.

Syrian air force raids left 15 people dead in rebel-held areas in the east of Aleppo city. Nine civilians died in rebel shelling on the government-held west, the Syrian Observatory for Human Rights said.

Another 27 people were killed in Syrian and Russian raids targeting a string of towns in the west of Aleppo province, the Britain-based group added.