"A number of Boko Haram commanders" were freed as part of Thursday's release of the girls, a source close to the negotiations between the Islamist militant group and the Nigerian government said on condition of anonymity.
This contrasts with what the Nigerian government has said, which is that the girls' release was not a prisoner exchange.
"This was not a swap," Nigerian Information Minister Alhaji Lai Mohammed said Thursday. "It is a release, the product of painstaking negotiations and trust on both sides."
A separate source, one with direct knowledge about the girls' release, told CNN Thursday that no captive Boko Haram fighters were released in exchange for the girls.
The 21 that Boko Haram released Thursday were among the 276 girls and women, ages 16 to 18, that militants herded from bed in the middle of the night at a boarding school in Chibok, Nigeria, in April 2014 -- a kidnapping that spurred global outrage.
As many as 57 girls escaped almost immediately in 2014, and one was found this spring
. Just under 200 remain unaccounted for after their release.
The 21 were freed before dawn Thursday in the northeastern Nigerian town of Banki, near the border with Cameroon, the first anonymous source said.
The Nigerian government did not release terms of the arrangement, but said that it came after negotiations brokered by the International Committee of the Red Cross and the Swiss government.
Chibok is in northeastern Borno state, where Boko Haram is strongest. The militants were believed to have taken their captives to the dense Sambisa forest, a reputed Boko Haram stronghold.
The terror group, which pledged allegiance to ISIS in March 2015, aims to impose a stricter enforcement of Sharia law across Africa's most populous nation, which has a Christian-majority south and a Muslim-majority north.
Since the group launched an uprising in the northeast in 2009, thousands of people have been killed in the conflict and about 2 million people have been displaced, according to the UN's Office for the Coordination of Humanitarian Affairs. Boko Haram also is blamed for attacks in neighboring countries.
The girls' release comes amid an apparent split in the terror group, with ISIS introducing an alleged Boko Haram leader in the summer
even as Boko Haram's longtime chief maintained that he still was in charge.
The 2014 kidnapping prompted global figures such as Pakistani education activist Malala Yousafzai
and US first lady Michelle Obama to support a #BringBackOurGirls campaign on social media.
Series of videos showed captives this year
The students' release also comes amid pressure from the girls' families on the Nigerian government to secure their freedom from whomever still held them.
The pressure increased as Boko Haram, or groups claiming to represent it, issued videos over a period of months showing some of the kidnapped students, apparently to prove to the government that some were alive and to make demands, such as the release of captured Boko Haram fighters.
This includes a recording, believed to have been recorded in December, that CNN exclusively obtained in April
showing 15 of the girls.
Another video, addressed to the girls' families in August
, shows 50 girls wearing headscarves. A father of one of the captives told CNN that his daughter and other Chibok students were in the video.
In that recording, a militant says that 40 girls were married off. The militant claims some girls were killed in a Nigerian airstrike.
A Boko Haram insider told CNN in August that despite the leadership split, longtime leader Abubakar Shekau still controlled the Chibok girls
and was thought to be hiding in the forest.
According to the Global Terrorism Index released last year, Boko Haram was the world's deadliest terrorist group in 2014, before it pledged allegiance to ISIS, the terror group that controls parts of Syria and Iraq.
That year, the GTI said, Boko Haram was responsible for 6,644 deaths, compared with ISIS, which was responsible for 6,073.