Activists say Syrian rebels have retaken two villages from Islamic State militants as they fight to undo gains made by the extremist group in a surprise offensive in Syria's north Friday that displaced over 100,000 people.

The Local Coordination Committees, an activist network inside Syria, says rebels retook the villages of Kafr Shoush and Braghida on Sunday, expanding their buffer around the rebel-held town of Azaz, home to tens of thousands of war refugees.

The IS advance threatened to swallow up the northern town, sparking alarm from leading international relief organizations.

The rebel pocket around Azaz, which connects to the Turkish border, used to form a supply corridor to opposition-held quarters in Aleppo, Syria's largest city.

Aleppo-based media activist Ahmad Primo confirmed the rebel gains.