Amina Ali Darsha Nkeki, rescued from Boko Haram in May, presents her child to President Muhammadu Buhari in Abuja. Photograph: Afolabi Sotunde/Reuters
Garba Shehu, a spokesman for President Muhammadu Buhari, confirmed that 21 of the released girls were in the custody of the state services department. Local media reported that Boko Haram had dropped the girls at a location from where the military picked them up.
The release of the girls, in a limited number, is the outcome of negotiations between the administration and Boko Haram brokered by the International Red Cross and the Swiss government. The negotiations will continue, Shehu said.
The president welcomes the release of the girls but cautioned Nigerians to be mindful of the fact that more than 30,000 fellow citizens were killed via terrorism.
Another official said the released girls were tired.
Four Boko Haram prisoners were swapped for the girls, defence officials confirmed, adding that they expected more girls to be released in the near future.
Were not authorised to release the details of how the girls were retrieved yet but the operation to retrieve the girls is ongoing. We are optimistic we will retrieve more of the Chibok girls from Boko Haram very soon, in the coming weeks, Gen Rabe Abubakar, a defence ministry spokesman, said.
When Buhari took power in May 2015, he vowed to crush Boko Haram within a year. While government forces have taken back large amounts of territory from the group, it has remained active, killing hundreds of people in suicide bombings.
The #BringBackOurGirls campaign group said Thursdays release was a wonderful development that confirmed what we have always known about the capacity of our government to rescue our #ChibokGirls.
Following this development, we trust that our government will continue to work to keep the safety, security, and wellbeing of the other girls a high priority, it said in a statement. We further urge the international community to continue to support our governments effort to rescue all other abducted Nigerians, so that parents, the Chibok community, the nation and the world can finally put an end to this nightmare once and for all.
The Chibok girls are among thousands of adults and children who have been abducted by Boko Haram during its seven-year insurgency. The group is short of manpower and has turned to abductions as recruitment has slowed.
Negotiations with Nigerian government representatives for the release of the schoolgirls have been complicated by splits within Boko Haram. The movement has fractured into two, possibly three factions over the issue of links with Islamic State.
Isis, of which the Nigerian group is still theoretically an affiliate, announced last month that Abu Musab al-Barnawi was Boko Harams new leader, replacing the erratic Abubakar Shekau. The decision may have been prompted by Shekaus use of female suicide bombers and targeting of Muslims.
A suicide bomber in Maiduguri, the capital of Borno State and birthplace of Boko Haram, killed eight people on Wednesday.
British and US special forces have been assisting the Nigerian military in their campaign against Boko Haram. Support from soldiers in the neighbouring countries of Niger, Cameroon and Chad was critical in pushing back the extremists, experts said.
Shekau has continued to claim to be in control of the group. A video released of the Chibok girls in August seemed to have come from his camp somewhere in the sprawling Sambisa forest, in Borno. It showed about 50 of the girls and included a demand for the release of imprisoned militants in exchange for them.
The previous government, under Goodluck Jonathan, conducted high-level negotiations before realising it was talking to impostors.
Buharis government was previously thought to be attempting to rescue the girls. The army had launched airstrikes on Boko Haram strongholds and claimed to have wounded or even killed Shekau. The extremist leader subsequently appeared, apparently unhurt, in a video.
Abubakar said on Thursday: It doesnt matter whether he is dead or alive, the main thing is the group is being defeated.
The Boko Haram of today is not the one of years ago. They can only bomb locations now because they hold no territory and we are defeating them at each stage. The government is negotiating with Boko Haram, including prisoner swaps, but at the same time we the military are degrading them where we can. That is proving an effective way of defeating this group.
Elizabeth Donnelly, an expert at Londons Chatham House, said the release suggested a potential opening with the insurgents.
There is still a question of why only this number [of girls has been released] but it shows that negotiations are possible and that is really important in trying to shift the nature of the conflict, Donnelly said.
In the past year, the Nigerian army has retaken towns and villages in the north-east controlled by Boko Haram, and has freed hundreds of women and children held captive. However, many survivors face rejection or are stigmatised when they return to their families or are settled in refugee camps.
In many areas of northern Nigeria, millions of victims of malnutrition, neglect and in some cases famine are surfacing, threatening a vast humanitarian crisis. Aid workers say hundreds of thousands of children are chronically malnourished.