The five "taken hostage by the Al-Nusra Front have been freed and have arrived in Arsal," a Lebanese town on the border with Syria, he said.
The national news agency (ANI) confirmed that five hostages had been released, although many other troops seized at the same time remain in the hands of different extremist groups.
The official, who did not want to be named, said the men had been handed over to a religious leader who had acted as a mediator. "They are still not in the hands of the security services," he added.
Three jihadist groups, including the Al-Nusra Front and Islamic State (IS), are still holding 15 soldiers and 14 police officers.
Also Read
The freeing of the men happened yesterday, several hours after a video was released showing the beheading apparently of a Lebanese soldier by IS, the extremist group which has carried out attacks in Syria and Iraq and who beheaded US journalist James Foley this month.
The Lebanese army has told AFP it is "investigating" the images.
While the Al-Nusra Front and IS share the same jihadist ideology, they are rivals on the ground in Syria.