(CNN) -- Boko Haram militants handed over 21 missing Chibok schoolgirls to the Nigerian government Thursday morning, according to a source with direct knowledge of the release.
The girls, who have not been named, remain in the northeastern city of Maiduguri, the source said.
The Nigerian government confirmed the release in a series of tweets.
Mallam Garba Shehu, spokesman for the Nigerian President, said the girls are in the custody of the Directorate of Social Services.
The head of Social Services has briefed the government, Shehu tweeted, and has said that the girls need to rest "with all of them very tired coming out of the process before he hands them over to the Vice President."
The militants herded 276 girls out of bed in the middle of the night at a school in Chibok in northern Nigeria in April 2014.
As many as 57 girls escaped and shared harrowing tales of fleeing from the nearby Sambisa Forest, believed to be the terror group's stronghold.
Dozens are still missing, and their whereabouts remain a mystery, but are believed to be somewhere in the forest. This is the largest group believed freed since the girls were kidnapped two years ago.
At the time, relatives roamed through the forest for days, frantically searching for the girls.
The kidnapping sparked outrage and prompted global figures such as activist Malala Yousafzai and first lady Michelle Obama to support the campaign to #BringBackOurGirls.
Boko Haram says its aim is to impose a stricter enforcement of Sharia law across Africa's most populous nation, which is split between a majority Muslim north and a mostly Christian south.
In previous videos from the militant group, its leader, Abubakar Shekau, has demanded the release of Boko Haram fighters in exchange for the Chibok girls.
No Boko Haram fighters were released in exchange for the girls, the source said. It happened as a result of a series of high-level negotiations involving the International Committee of the Red Cross, according to the source.