"I can only weep, right now. You know that kind of cry that is a mix of multiple emotions," Obiageli Ezekwesili, one of the leaders of the #BringBackOurGirls movement, has tweeted in response to the news.

The president also tweeted that he welcomed the release "following successful negotiations".

President Muhammadu Buhari's spokesman said on Twitter that the International Committee of the Red Cross (ICRC) and the Swiss government had acted as mediators in the talks with Boko Haram.

Mr Shehu added that negotiations were continuing.

Boko Haram has been driven out of most of its bases in northern Nigeria but in the past year, it has moved across the border to Chad.

In 2015, the Nigerian army rescued 200 girls and 93 women kidnapped by Boko Haram. International diplomats had previously expressed grave concerns about Nigerian authorities' ability to find the missing girls, newly released documents have shown.