Syrian rebels have pushed back the Islamic State (IS) group from two strategic villages near the Turkish border on Wednesday, following weeks of defeats in the key pocket and alleviating fears that the militants would cut off supply lines.

IS had captured several villages between the rebel-held northern towns of Marea and Azaz on 27 May and last week launched a fresh drive to oust Syrian opposition forces from their last stronghold in the Azaz area.

The assault forced thousands of people to flee and sparked concerns from aid groups that 100,000 civilians could find themselves trapped, while tens of thousands of displaced Syrians who have been sheltering in makeshift camps next to the Turkish border would also come under fire.

But on Wednesday morning, Turkey-backed rebels launched surprise simultaneous attacks from the two towns to squeeze IS militants out, according to the Syrian Observatory for Human Rights monitoring group. Activists also told Reuters that rebels were planning on pushing ahead with a counter-offensive and rolling back the militants further.

IS "did not fight hard, but rather withdrew, as they are facing attacks on numerous fronts in northern Syria," said observatory head Rami Abdel Rahman.

The monitor suggested that the sudden pullout from the strategically important villages indicated that IS was feeling the pressure in Syria, with the militants also under attack in Manbij where anti-IS forces are just now a few kilometres from the city.

The offensive has seen Syrian government troops, flanked by Russian airpower, advance from the south, while the Syrian Democratic Forces (SDF) – a US-backed coalition of Kurdish but also Arab fighters – have advance from the north. Thousands of civilians have fled the offensive, with Manbij now surrounded on three sides.

Tensions between Turkey and the US over the latter's support for the Kurdish-led SDF - which is allied to the outlawed PKK in Turkey - have mounted in recent weeks.

"We have surrounded Manbij from three sides and operations are progressing well," Sherfan Darwish, who is leading the SDF offensive told AFP on Tuesday. "Every day, we are liberating villages and the only route open to IS now is towards Aleppo city" to the west, Darwish told AFP by phone.

About 20,000 people are still living in Manbij, which had a pre-war population of about 120,000 - mostly Arabs, but about a quarter Syrian Kurds.

The "Manbij pocket" was the only remaining section of territory used by IS to smuggle recruits or funds from Turkey across the border.

The timing of the dual offensive has fuelled speculation that the government and the SDF, as well as their international backers, are coordinating closely against IS despite being bitterly divided about the future of Syria which the opposition insists cannot include Syrian President Bashar al-Assad.

Assad on Tuesday seemed to harden his position, vowing for the second time in recent weeks to recapture "every inch of Syria" in a move the US labelled unsurprising but "discouraging".

Syria's defence minister is now set to hold talks in Tehran on Thursday with his Iranian and Russian backers. Moscow has sent warplanes and special forces in support of Assad, while Tehran has deployed military advisers and trained and equipped pro-government militias.

It is expected that Russian Defence Minister Sergei Shoigu will vow to further step up strikes against rebel forces during the visit and will use the meeting to heavily criticise rebel groups for failing to deliver on a February ceasefire pledge to break ranks with al-Qaeda's Syria affiliate al-Nusra Front.

White phosphorous 'used in Aleppo'

Russia has also been on the offensive, continuing to pound Aleppo and other parts of Syria. On Wednesday, at least 15 civilians were killed by either government or Russian airstrikes, the monitor said, although local rescue workers known as the White Helmets put the toll at 23 dead.

2 unguided bombs (suspected barrel bombs) in Al Shaar area. 15 killed & a hospital destroyed. @aleppoisburning pic.twitter.com/ZGusQXlJ0S — The White Helmets (@SyriaCivilDef) June 8, 2016

In recent days, Damascus or its allies have also been accused of dropping white phosphorus munitions on Aleppo. The chemical can burn through a victim's skin and bones, and cause organ failure. It was famously used by Israel during its 2009 war with Gaza and by US forces in Fallujah in 2004.

Russia has yet to comment on the allegations but claims first emerged last year when activists alleged the chemical was being dropped on IS-held Raqqa.

The chemical is not prohibited under international law but is banned for use in densely populated areas.