Dozens have since escaped but aeound 200 girls remain missing, causing global outrage.
Negotiations would continuing to bring home the rest of the girls, according to a statement from the President Muhammadu Buhari.
"It is the first step in what we believe will be the release of all the girls," Information Minister Lai Mohammed told reporters.
He denied reports that the government had swapped imprisoned Boko Haram fighters for their release and said he was not aware whether any ransom had been paid.
However the President’s spokesman, Garba Shehu, said the release was "the outcome of negotiations between the administration and Islamist militants", according to the BBC.
The Swiss government “facilitated contacts between representatives of the Nigerian government and intermediaries of Boko Haram” after a request from Abuja, a spokeswoman said in a statement.
“We have nothing to add,” she said, when asked if it had been a prisoner swap.
The girls were released at 5.30 am on Thursday and have been taken to the capital Abuja to meet doctors and psychologists, Mr Mohammed said.
In May, authorities announced one of the missing girls had been found, however there have been a number of similar reports in the past that proved to be false alarms.
A large-scale offensive in the Sambisa forest, one of Boko Haram’s remaining strongholds, was launched in the past days by the Nigerian military in the hopes of rescuing more of the girls.
Since the beginning of 2015, Nigeria's army, aided by troops from neighbouring countries, has recaptured most of Boko Haram’s territory, which was once equivalent to the size of Belgium.
Beyond Chibok: Report shows alarming trends in countries affected by Boko Haram
Show all 16
The extremist group published a video in August apparently showing recent footage of dozens of the kidnapped girls, and said some had been killed in air strikes.
Boko Haram has kidnapped hundreds of men, women and children but the kidnapping of the Chibok girls brought it worldwide attention.
In the last few months Mr Buhari has said his government was prepared to negotiate with Boko Haram over the release of the girls.
Additional reporting by Reuters.
Join our commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies
Join our commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies