Fighters from Hayat Tahrir al-Sham (HTS) agreed to withdraw to Idlib province after Hezbollah, backed by Syrian forces, launched an offensive.
The jihadists were targeted in the Juroud Arsal region, which had become a bastion for the group.
The evacuation follows the exchange of fighters' bodies and a prisoner swap.
Hezbollah's media unit said about 9,000 jihadists and civilians, including those from refugee camps around the Lebanese town of Arsal, had agreed to leave the area.
The evacuation was due to take place on Monday but the Lebanese military said it had been delayed because the militants had demanded the release of more prisoners.
The deal began with the exchange of the remains of nine HTS and five Hezbollah fighters on Sunday, according to Hezbollah sources.
On Tuesday evening three Hezbollah fighters were swapped for three Syrian detainees being held in Roumieh prison, the Lebanese authorities said. Hezbollah said its fighters had "lost their way" during the ceasefire announced last week.
HTS - an alliance between four small Syrian jihadist groups and Jabhat Fateh al-Sham, al-Qaeda's former affiliate in Syria - has become the dominant force in Idlib after clashing with rival jihadists and rebel groups there over the past few months.
Lebanese Shia movement Hezbollah, together with allied Syrian forces, launched a campaign on 21 July to drive the Sunni group out of the border region.
It declared a ceasefire on Thursday, having taken over most of the area.
Similar deals where rebels have withdrawn to Idlib have ended fighting in parts of Syria.
The barren hills of Juroud Arsal and neighbouring Qalamoun mountains have served as a haven for JFS and Islamic State (IS) militants since early on in the Syrian war, which began in 2011.
JFS militants have also found shelter among the refugee camps around Arsal, home to tens of thousands of civilians who have fled the conflict.
Hezbollah is expected to launch a similar offensive against IS in the area.
A Sunni enclave surrounded by Shia villages, Arsal was the scene of an attack in 2014, when more than two dozen Lebanese security force members were seized by militants from the Nusra Front and IS who had crossed the border from Syria.
Sixteen have since been released and four killed by their captors.
Thousands of jihadists and their families are relocating to Syria from the border with Lebanon as part of a ceasefire deal with Hezbollah.