BEIRUT — Lebanon’s official news agency says an al-Qaeda-linked Syrian rebel group has released four Lebanese soldiers and one policeman captured earlier this month in a cross-border raid.

The soldiers were captured on August 2 when militants from Syria rampaged through the Lebanese town of Arsal for five days, kidnapping and killing soldiers before withdrawing toward the Syrian border, taking with them a number of captive soldiers and policemen.

The National News Agency said Sunday that the Nusra Front, al-Qaeda’s Syrian affiliate, released the five men late Saturday and that the army received them Sunday morning. All five are Sunni Muslims.

Three jihadist groups, including the Al-Nusra Front and Islamic State, are still holding 15 soldiers and 14 police officers.

The freeing of the men came 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.

The jihadists say they want to swap the hostages for Islamist prisoners being held in Lebanon, although the army has demanded the immediate, and unconditional, release of the soldiers.

While the Al-Nusra Front and IS share similar jihadist ideology, they are rivals on the ground in Syria.

AFP contributed to this report.