Five Boko Haram commanders have been released in exchange for the freedom of 82 Chibok schoolgirls, a Nigerian government official said.
The confirmation of the prisoner swap comes a day after the young women were liberated after more than three years in captivity with the Islamic militants.
President Muhammadu Buhari said on Saturday that some Boko Haram prisoners had been released for the freedom of the schoolgirls but he did not give any details.
The freed young women "will face a long and difficult process to rebuild their lives after the indescribable horror and trauma they have suffered at the hands of Boko Haram," said Pernille Ironside, acting representative of Unicef Nigeria.
Authorities say 113 schoolgirls remain missing of the 276 girls abducted from their boarding school in 2014.
Girls who escaped said some of their classmates had died from illness. Others did not want to come home because they had been radicalised by their captors, they said.
Human rights advocates also fear some of the girls kidnapped from the Chibok boarding school were used by Boko Haram to carry out suicide bombings.
In Nigeria's capital, Abuja, anxious families were awaiting the official list of names of the 82 schoolgirls freed. Some parents have not lived long enough to see their daughters released, underscoring the tragedy of the three-year saga.
Last year, 21 other Chibok girls were liberated in October and they have been undergoing counselling for months. It was not immediately clear whether the newest girls freed on Saturday would join them.
Those girls are still in government care in Abuja for medical attention, trauma counselling and rehabilitation, according to the government. Human rights groups have criticised the decision to keep the girls in Abuja, nearly 560 miles from Chibok.
The newly freed schoolgirls should be quickly released to their families and not be subjected to lengthy government detention, Amnesty International's Nigeria office said.
The International Committee of the Red Cross, which along with the Swiss government has mediated negotiations between Nigeria's government and Boko Haram, said the girls soon would meet with their families.
Saturday's release marks the largest negotiated release so far of the 276 girls whose abduction in 2014 drew international attention to the threat of Nigeria's extremists.
Boko Haram has pledged allegiance to the Islamic State, and has increasingly carried out attacks in neighbouring countries.
The schoolgirls kidnapped from Chibok in 2014 are among thousands of people abducted by Boko Haram over the years.
A Nigerian military official with direct knowledge of the rescue operation said the freed girls were found near the town of Banki in Borno state near Cameroon.
Mr Buhari late last year announced Boko Haram had been "crushed," but the group continues to carry out attacks in northern Nigeria and neighbouring countries. Its insurgency has killed more than 20,000 people and driven 2.6 million from their homes, with millions facing starvation.