Twenty-one of the 218 missing Nigerian schoolgirls abducted in 2014 by
The girls were released in northern Borno State, rescued by a military helicopter and transported to the state capital, Maiduguri, said Mallam Garba Shehu, spokesman for President Muhammadu Buhari.
Officials said the International Committee of the Red Cross and the Swiss government acted as neutral intermediaries leading to the first major breakthrough since the girls' kidnapping in April 2014.
Nigeria's minister of information and culture, Lai Mohammed, told reporters in Abuja that the rescued girls were being flown to the nation's capital for treatment and trauma counseling.
"Ahead of their arrival, we have assembled a team of medical doctors, psychologists, social workers, trauma experts to properly examine the girls, especially because they have been in captivity for so long," he said. "They will also be adequately debriefed."
Mohammed said the government was in the processing of contacting parents and relatives. He denied media reports based on unnamed officials that the girls were swapped for Boko Haram commanders.
"As we have always said, we have been working on the safe release of the girls and following all the leads available," Mohammed said. "Please note that this is not a swap. It is a release, the product of painstaking negotiations and trust on both sides. We see this as a credible first step in the eventual release of all the Chibok girls in captivity."
Shehu said in a statement on Twitter: "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 by terrorism."
Nearly 200 girls are still missing, some believed to have been killed in Nigerian air force strikes on militants' positions. Shehu said negotiations were continuing to secure the release of the other girls.
Before the latest release, only one of the missing 219 schoolgirls kidnapped from the town of Chibok had been freed. Amina Ali Nkeki was found in May with her Boko Haram husband in the Sambisa forest, a stronghold of the extremist militia.
The 276 girls initially abducted were sleeping at a school in preparation for examinations, at a time when Boko Haram had been targeting schools, killing teachers, firebombing dormitories and warning schools to close.
Several dozen escaped, but the remaining 219 were taken into the Sambisa forest by gunmen.
The group's leader, Abubakar Shekau, announced in a video shortly afterward that the girls were "slaves."
Like thousands of other women and girls abducted in northern Nigeria in recent years, the girls are believed to have been forced into marriage with Boko Haram fighters.
Yakaka, 14, a Nigerian girl from a village near Bama, in Borno State, one of thousands of women and girls seized by Boko Haram in recent years, said she witnessed many of the Chibok schoolgirls killed in a Nigerian air force airstrike this year.
She spoke to The Times in an interview in Maiduguri last week. Her surname is not used because she is a minor and a victim of sexual assault.
Yakaka said that after being abducted while fetching water and forcibly married to a Boko Haram fighter, she was taken by the insurgents with other women to a camp in the Sambisa forest. She escaped two months ago and was held by the Nigerian military until this month, before being transferred to Dalori, a camp for displaced persons in Maiduguri. She is four months pregnant.
In the militants' camp, she saw several dozen girls held nearby, who Boko Haram fighters said were abducted in Chibok in April 2014. She and other abductees in her camp were not allowed to approach the Chibok girls, who were kept isolated from the other women and girls.
"Insurgents said to us, 'Those are the Chibok girls.' It was close to where Shekau was staying," she said, referring to the Boko Haram leader. "The insurgents didn't let us go near them. We'd see them when we were collecting water."
Even then, she and other women were prevented from speaking to the Chibok girls.
"There were many of them, but there was an airstrike that hit them," she said. "The worst part was the airstrikes. And the worst, most scary part was being abducted. You don't see any members of your family, your parents and brothers and sisters. It's so painful."
Ayuba Alamson, the guardian of four nieces who were kidnapped, expressed joy that the 21 girls were released and called on Boko Haram to free the remainder and enter into peace talks with the government.
"At this moment, I am very, very excited," he said by phone from Maiduguri. "I am full of happiness.
"It's what we have been expecting would happen for a long time now. If the government won't do it, God will do it. We are continuing to pray that God will open the way for all of them to come back."
He said it was time for Boko Haram "to repent the violence it has caused to humanity. It's high time for them to repent and start dialogue with the government.
"I ask now to please release the girls because none of these girls are government politicians or government officials. They're from ordinary poor families who just farm to feed themselves."
Alamson said even though his four nieces may not be among those released, he still was overjoyed that at least some of the abducted girls had been freed.
The Islamist extremists, allied to Islamic State, have lost most of their territory in recent months but are still capable of carrying out deadly attacks, the latest a suicide bombing in Maiduguri on Wednesday that killed eight people and has been blamed on a female suicide bomber.
The Chibok mass kidnapping, which triggered a global hashtag campaign #BringBackOurGirls on Twitter, was the second-largest, after a mass abduction in Damasak in 2014, where at least 400 people, mostly schoolchildren, were abducted.
A spokeswoman for the International Committee of the Red Cross, Elodie Schindler, confirmed that the ICRC helped transfer the 21 girls to safety.
"Today we transferred 21 of the #Chibokgirls and handed them to the #Nigeria government authorities, acting as a neutral intermediary," the organization tweeted. "We cannot provide any further comment at this stage in the best interest of the girls concerned."
Special correspondent Abubakar reported from Kano, Nigeria, and Times staff writer Dixon from Johannesburg, South Africa.
12:45 p.m.: This article has been updated with comments from the Nigerian minister of information and culture.
7:15 a.m.: This article has been updated with comments from a teenager who was seized by insurgents and escaped recently.
5:22 a.m.: This article has been updated with comments from Ayuba Alamson, the guardian of four of the girls who were kidnapped.