The Lebanese army and Syria's al-Nusra Front have conducted a long-awaited prisoner swap outside Lebanon's border town of Arsal, where a group of Lebanese soldiers were kidnapped last year.
The deal, brokered by Qatari mediators, entailed the release by al-Nusra Front of 16 Lebanese security officers - soldiers and policemen - in exchange for 13 prisoners, including five women, held by the Lebanese.
On Tuesday, the staff of the Lebanese Red Cross were present at the site of the exchange alongside the Lebanese army soldiers as al-Nusra Front fighters, sitting in the back of vehicles, celebrated the deal by waving the group's flags.
Descending in a convoy of SUVs from Arsal, the freed soldiers, freshly shaved and in uniform, greeted relatives in Lebanon's Council of Ministers in downtown Beirut.
Surrounded by Lebanese officials, including the prime minister, the head of General Security, the justice minister, and the Qatari ambassador, the freed military officials were carried on the shoulders of the crowds, as rice and flowers were thrown over them.
One of the freed soldiers told Al Jazeera: "We would like to thank al-Nusra Front for releasing us. We would like to thank everyone who took part in the negotiations that led to our release."
At the initial stage of the exchange, al-Nusra Front handed over the body of Mohammed Hamieh, one of two soldiers killed by its fighters.
The 16 Lebanese security officers - plus two soldiers who were killed in captivity - were kidnapped by al-Nusra Front during deadly clashes in August 2014 in Arsal.
The prisoner exchange followed months of negotiations.
Al-Nusra Front has been fighting the Syrian government since 2012. It has pledged allegiance to al-Qaeda's leader, Ayman al-Zawahiri.
Ex-wife of ISIL leader released
Among the prisoners released by Lebanon are Jumana Hmayed, who was arrested for transporting "terrorists into Lebanon", and Saja Dulaimi, former wife of Abu Bakr al-Baghdadi, leader of the Islamic State of Iraq and the Levant (ISIL) group.
Lebanese security forces arrested Dulaimi in November 2014 in northern Lebanon, on charges of belonging to a "terrorist group".
In June 2015, she gave birth in prison to a baby girl. Also included in the exchange were her children who remained with her during her incarceration.
Speaking to Al Jazeera shortly after her release in Arsal, Dulaimi said she intended to go to Turkey.
"I am Abu Bakr al-Baghdadi's ex-wife. We have been divorced for over six years now. I will head to Beirut and plan on leaving to Turkey," she said.
Abbas Ibrahim, head of Lebanon's general security and in charge of the hostage file, said in a press conference that while the process was long and difficult, they were able to achieve results.
"Following 16 months of pain in a difficult situation, this day of joy has arrived," he said. "And in spite of its difficulties, it was important that we respected Lebanon's sovereignty by bringing back its soldiers."
According to sources involved in the hostage file, the agreement for the release included: setting up a humanitarian corridor to allow the flow of aid to those in the outskirts of Arsal; sending wounded from Arsal to Turkey to receive medical treatment; providing legal statehood for others wounded looking to remain in Lebanon; creating a 'safe zone' in Wadi Hmayed for those residing there; and providing medical equipment to the hospital in Arsal while also setting up a mobile clinic in its outskirts.
A festive atmosphere prevailed in downtown Beirut.
The families of the hostages had refused to remove their encampment in the city's downtown until a swap was completed.
"Of course, we are so happy to finally get [Hamieh's body] back," a relative of the dead soldier said in Beirut, tears running down her cheeks.
Rafik Halabi, a relative of Maher Fayyad, one of the hostages freed by al-Nusra Front, told Al Jazeera: "Today is a great day, not just for the families but for all of Lebanon. The whole country should be celebrating."
"We have spent the last year and three months unable to eat, sleep, or even live properly, so today has brought us relief and happiness."
Previous attempts at completing the prisoner swap had fallen short and, over the weekend, the spectre of failure loomed again as al-Nusra Front included new demands at the eleventh hour, according to Lebanese sources.
They said al-Nusra Front sought the inclusion of the case of Mustapha Hujeiri, who has been key in mediating with the group, and had been handed a life sentence in absentia by Lebanese courts.
The August 2014 clashes in Arsal left 19 Lebanese soldiers dead and a further 35 soldiers and policemen held captive by ISIL and al-Nusra Front.
In the ensuing period, seven of the captives were released. Subsequently, two soldiers were beheaded by ISIL and another two were killed by al-Nusra Front.
Currently there are 16 soldiers with al-Nusra Front and nine with ISIL.
In a related development on Tuesday, the Lebanese government said it is ready to negotiate with ISIL.
Major-General Abbas Ibrahim, the head of General Security, told Reuters news agency that joy at Tuesday's release of the Lebanese security officers was incomplete because of the nine captives still held by ISIL.
Hopes of negotiations
Speaking to Al Jazeera, Wael Abu Faour, Lebanon's health minister, said: "We will do our best to secure the release of the remaining hostages.
"There had been some channels, through mediators, before with them, but this was before the international coalition started their raids on Raqqa."
"The talks stopped after the raids started," he said, adding that hopes of resumption have been raised by Tuesday's swap.
Speaking to Al Jazeera in Beirut, Mario Abou Zeid, a military and political analyst with Carnegie Middle East, said: "A year ago, the question of a prisoner exchange was dismissed by the Lebanese state.
"However, a lot of pressure has since been put on the state, especially as it has not had a president and parliament is barely functioning.
"The state accepted this deal because it was desperate to recover the soldiers alive, and there was a very real threat they could be killed in the winter months.
"The prisoners held by the Lebanese authorities were no longer high profile. The authorities were able to extract all the information they wanted from the prisoners during their interrogations and incarceration."
On the other hand, Abou Zeid said, "this is a winning situation for al-Nusra Front, and there is a big focus now on the group to reshape its image.
"They are trying to portray themselves as the champion of the people, and this is why they allowed the swap to take place."
Additional reporting by Mazen Ibrahim in Arsal.
Source: Al Jazeera