By Tom Perry and Mariam Karouny
BEIRUT (Reuters) - The Lebanese army tightened its grip on a town seized by hardline Islamists at the weekend as a truce appeared to hold on Thursday, and the military was assessing how many of the gunmen had left to the adjacent border zone.
One of the militants said by telephone that the gunmen had entirely withdrawn from the border town of Arsal. A Syrian witness in the town said the same.
A Lebanese security source said the militants appeared to be pulling out gradually, but the army was still assessing the situation. A Lebanese political source familiar with the situation on the ground said some of the militants were still in the town.
Dozens of people, including 17 soldiers, have been killed in fighting that marks the most serious spillover of violence into Lebanon since the Syrian civil war erupted three years ago. The militants include fighters from the Islamic State, which has seized territory in both Iraq and Syria.
The taking of Arsal was the first major incursion into Lebanon by hardline Sunni militants - leading players in Sunni-Shi'ite violence unfolding across the Levant - which threatens the stability of Lebanon by inflaming its own sectarian tensions.
Several dozen members of the security forces - both army and police - had been taken captive by the militants.
Advancing soldiers found three policemen alive and well at a clinic in the town. Around 20 soldiers are still unaccounted for, according to an official tally.
The ceasefire was brokered by a body of Lebanese Muslim clerics who said on Wednesday they had secured the release of three soldiers held by the militants.
The army opened fire, killing 14 militants, on Wednesday evening when soldiers were fired upon, the security source said.
"The army is investigating whether the gunmen have all withdrawn from Arsal in accordance with the agreement between the government and the Muslim Clerics Association," he said on condition of anonymity. The army has not yet entered the heart of Arsal.
The Red Cross was able to enter the town on Thursday and recovered 35 wounded civilians, the source said.
The battle in Arsal, a predominantly Sunni Muslim town, has triggered unrest in other parts of Lebanon. A bomb exploded near an army patrol in the northern city of Tripoli, also predominantly Sunni, killing one person and wounding 11 on Wednesday evening, security sources said.
(Additional reporting by Oliver Holmes and Laila Bassam; Editing by Toby Chopra and Will Waterman)