France's last remaining hostage, Serge Lazarevic, has arrived home to a welcome from family members and French President Francois Hollande.
The 51-year-old was flown into a military airport outside Paris.
Mr Lazarevic was snatched in Mali in November 2011 with fellow Frenchman Philippe Verdon. Mr Vernon was killed by militants from al-Qaeda in the Islamic Maghreb (AQIM) last year.
Mr Hollande says there are no more French hostages anywhere in the world.
The French government has repeatedly denied paying ransoms for the release of captives.
Mr Lazarevic was greeted by his daughter and other relatives, as well as Mr Hollande and French Defence Minister Jean-Yves Le Drian, after his plane touched down at the Villacoublay military airport on Wednesday.
In his first words on French soil, he said how wonderful it was to regain his freedom. "When you're on the verge of death, you think more about life," he said.
President Hollande welcomed him back, warning French travellers not to venture into areas where they could risk kidnap. "It's a dangerous world," he said.
Philippe Verdon's son, Clement, was among those welcoming Mr Lazarevic home and Mr Hollande said he was also thinking of Mr Verdon's family.
Mr Lazarevic was expected to be taken immediately to a military hospital for check-ups before joining his family.
There have been no details about how the release of Mr Lazarevic was secured. Anonymous sources told Reuters news agency that several Islamist-linked militants held in Mali were freed as part of a prisoner swap. Two were the main suspects behind the 2011 kidnapping, a Malian newspaper reported.
When asked about the reports, Agriculture Minister Stephane Le Foll refused to comment on things he did not know, but said only that there had been negotiations: "That's all you need to say."
France does not officially pay ransoms to militant groups but former anti-terrorism judge Alain Marsaud told French radio that some form of payment must have been made. "If it isn't the government, it's someone: maybe a business or an insurance company," he said.
TV footage had earlier shown Mr Lazarevic smiling as he told reporters in Niger that he had lost about 20kg (44lb) during his ordeal.
"I would like to thank the people of Niger who have collaborated with France to get me freed," he said, adding that he felt "fine".
Mr Hollande also thanked the authorities in Niger and Mali, who had "worked towards this happy outcome".
AQIM kidnapped a number of Western hostages before the French military deployed its forces against the group in January 2013.
There were at one point at least 14 French nationals being held by Islamists in West Africa.
During his captivity, Mr Lazarevic appeared in several AQIM videos.
Mr Verdon was killed last year, with the militants saying it was in retaliation for France's intervention in Mali.
There was concern for his health in November after he was filmed pleading for his release.
He looked frail in the video and was filmed alongside a second hostage, Dutchman Sjaak Rijke.
It is not clear where the two men were held or whether they were held together.
Mr Rijke was kidnapped in November 2011, while visiting the city of Timbuktu as a tourist. There has been no news from him since the video.