Officials said the girls were released early hours of Tuesday.
Governor Bello Matawalle of Zamfara State posted on Twitter: "Alhamdulillah! It gladdens my heart to announce the release of the abducted students of GGSS Jangebe from captivity.’’
" This follows the scaling of several hurdles laid against our efforts. I enjoin all well-meaning Nigerians to rejoice with us as our daughters are now safe."
Seven out of the 317 schoolgirls had escaped from the bandits while trekking in the forest.
The girls were abducted at about 1am on Friday barely a fortnight after 27 schoolboys, three teachers and some 12 people were abducted in Kagara in Niger state.
Boko Haram gunmen seize 276 girls aged between 12 and 17 from the Government Girls Secondary School in the remote town of Chibok in northeastern Borno state on April 14, 2014.
The girls are forced from their dormitories onto trucks and driven into the bush.