Syrian troops have captured a famed Crusader castle near the border with Lebanon, raising the two-starred government flag above the stone ramparts of the 12th century fortress after days of intense clashes with rebel fighters.

Lebanese private broadcaster, Al-Mayadeen TV, aired footage of Syrian soldiers walking unopposed into the Crac des Chevaliers on Thursday.

The loud crackle of celebratory gunfire could be heard as troops explored the sprawling castle, which is a UNESCO World Heritage site, according to the Associated Press news agency.

The military's push into the Crac des Chevaliers marked the latest battlefield gain for President Bashar al-Assad's forces.

Government troops have seized at least four towns and villages during the past two weeks near the border with Lebanon, as the army tries to sever opposition supply lines across the mountainous frontier.

The biggest blow to the rebels came with the fall of their stronghold of Yabroud, near Lebanon's eastern border, on Sunday.

But the government capture of the Crac des Chevaliers, which dominates the surrounding valley and terraced hills below, marked another setback for the rebels, for symbolic reasons as much as strategic ones.

Rebels had controlled the castle since 2012.

"Our efforts, those of the Syrian Arab Army and the National Defence Forces, were crowned today by raising the Syrian flag on the Crac des Chevaliers,'' an unnamed Syrian army colonel told Al-Mayadeen.

"The battle had been going on for more than a month during which several nearby villages were liberated,' the colonel said.'

Syrian state television said troops "wiped out terrorists who were entrenched in the castle".

An activist based in Homs said the citadel fell into the hands of government troops earlier on Thursday, a day after rebels and the government agreed that opposition fighters be given safe passage to Lebanon.

The activist, who goes by the name of Beibares Tellawi, told Associated Press news agency that troops captured Hosn, the town at the foot of the castle, after an intense bombardment by the Syrian air force.

The UK-based Syrian Observatory for Human Rights said fighting around Hosn killed 12 fighters on Thursday.

The dead included the local leader of the Jund al-Sham Islamic group. Lebanese television stations identified the dead

commander as Abu Suleiman Dandashi, a Lebanese national.

Syria's state news agency said "a number of terrorists were killed'' as they tried to flee Hosn towards Lebanon.

An activist in Homs who goes by the name of Samer al-Homsi said people fleeing Hosn were ambushed near the Lebanon border and many were feared dead.