Presidential spokesman Mallam Garba Shehu tweeted Thursday that the girls are in the custody of Nigeria's Department of State Services.
He said the release is a result of negotiations between the government and Boko Haram, brokered by the Swiss government and the International Red Cross. He said negotiations will continue.
The abduction of 276 schoolgirls in April 2014 brought international condemnation of Boko Haram, Nigeria's home-grown Islamic extremist group. Dozens of the girls escaped, but most remain missing.
Boko Haram leader Abubakar Shekau has said the girls would only be released if the government swaps them for detained extremist leaders.