The fall of Yabroud, the last rebel bastion near the Lebanese border, could sever a vital insurgent supply line from Lebanon and consolidate government control over a swathe of territory from Damascus to the central city of Homs.
The army "restored security and stability to Yabroud...after eliminating a large number of terrorist mercenaries", the Syrian military said in a statement hailing the strategic victory.
A military source told Reuters that about 1,400 rebels from the Free Syrian Army, Ahrar al-Sham and other factions had fled Yabroud in the past two days. Another 1,000 militants from the al Qaeda-linked Nusra Front had held out on Saturday to fight government forces which had entered eastern districts of Yabroud and captured several hilltops.
"They fought a fierce battle and then from last night until the early hours of today they all pulled out," he said.
The source said the militants had withdrawn to the nearby villages of Hosh Arab, Fleita and Rankos as well as Arsal, a Lebanese border town 20 km (13 miles) to the northwest.
Hezbollah-operated Al Manar television broadcast scenes from Yabroud's main square where people walked around and talked in apparent safety. Soldiers replaced the three-star flag of the Syrian revolution with the government's two-star banner.
Footage from earlier in the day showed empty streets, shuttered shops and abandoned homes in a main thoroughfare. Heavy gunfire could be heard in the background.
The anti-Assad Syrian Observatory for Human Rights monitoring group said fighters from the Lebanese Shi'ite Muslim militant group Hezbollah, who supported the Syrian army and pro-government fighters in sealing off the frontier area with Lebanon, were now in charge of large parts of Yabroud.
"The Nusra Front had a lot of influence in the region, but their influence has now ended," Rami Abdelrahman, head of the Observatory, told Reuters. He said it was unclear where the more than 2,000 foreign fighters in the area had ended up.
The army was dismantling a large number of explosive devices planted by the rebels in Yabroud, Syrian state television said.
Thousands of civilians fled Yabroud, a town of about 40,000 to 50,000 people roughly 60 km (40 miles) north of Damascus, and the surrounding areas after it was bombed and shelled last month ahead of the government offensive.
The government has been making incremental gains along the land route and around Damascus and Aleppo in the past months, regaining the initiative in the three-year uprising-turned-civil war which has killed more than 140,000 people.
Syria's Mediterranean coastal region is strategically vital for Assad because it is the heartland of his minority Alawite community, whose faith is an offshoot of Shi'ite Islam.
The military source said that among the rebel positions the army seized was the headquarters where the Nusra Front had held hostage 13 Greek Orthodox nuns for more than three months before their release last week in a rare prisoner swap.
BATTLE TO CLOSE THE CROSSINGS
The military source said that in parallel to the capture of Yabroud, the army and air force had closed 14 of 18 crossings into Lebanon, where violence has spilled over in the past year.
"In the next few days, the battle will be over closing these remaining crossings," the source said.
Syrian television said the army was targeting rebels between Fleita and Arsal who had withdrawn from Yabroud. Al Manar said air raids had destroyed several trucks carrying fleeing militants near Arsal.
The military dropped barrel bombs on Ras al-Maara, a rebel-held village 10 km (6 miles) east of the Lebanese border, killing at least six people including two children, according to the Observatory.
An influx of militants into Lebanon from Syria threatens to further destabilise the small Mediterranean country whose own 15-year civil war ended in 1990. Sectarian tensions between Shi'ite and Sunni Muslims have already been heightened by the war in Syria, causing insecurity and political gridlock.
A local Lebanese official from Arsal told Al Arabiya television he wanted the Lebanese army to secure the border and prevent Sunni militants fleeing Yabroud from entering his town.
"We in Arsal are not ready to accept militants. Even if we support the revolution, the militants' battle is in Syria, not in Lebanon. Arsal will not be the place from which war is sparked inside Lebanon," he said.
A Lebanese security source told Reuters that Lebanon's army was confronting insurgents crossing the border from Syria. Forces in Arsal detained a group of Syrians carrying "weapons of war and ammunition," Lebanon's National News Agency said.
In a separate incident, the army fired on militants in a pickup truck near Arsal after they bypassed a checkpoint, but failed to prevent their escape, the security source said.
A Nusra Front fighter in Yabroud denied that the rebels had planned to withdraw to Arsal.