Last week, armed men stormed Government Science Secondary School in the town of Kankara, which has more than 800 pupils.
“At the moment, 344 of the students have been released and handed over to the security operatives. I think we can say at least we have recovered most of the boys, if not all of them,” Mr Masari said.
Arrangements are now being made to transport the returned boys to Katsina, where they will be reunited with their families.
“The news reaching us about an hour ago indicates that all of them have been recovered and they are on their way from the forest area to Katsina,” Mr Masari said, adding that they would be examined by doctors on Friday.
The government will be “working with the police and also to engage private security firms to safeguard schools” to prevent the “ugly experience of the last six days” from happening again, he said.
The Independent would like to keep you informed about offers, events and updates by email, please tick the box if you would like to be contacted
Read our full mailing list consent terms here
Officials are now negotiating with the attackers, jihadi rebels of Boko Haram who claimed responsibility for the abduction, to ensure the release of the remaining children. The group is known to recruit and exploit child soldiers.
News of the release came after a video, seen by the Associated Press, showed the apparent captors telling one boy to repeat their demands that the government call off its search for the schoolchildren.
The boy says he and the others were kidnapped by a gang, under orders from Boko Haram’s leader, Abubakar Shekau, and that some of those abducted from the school were dead.
Muhammadu Buhari, Nigeria’s president, welcomed the boys’ release, calling it “a big relief to their families, the entire country and to the international community”, according to a statement from his office.
Amid an outcry against the west African country’s government over insecurity in the north – where Boko Haram has waged a decade-long insurgency with the intention of imposing strict Islamic law – Mr Buhari noted his administration’s successful efforts to secure the release of previously abducted students.
The leadership “is acutely aware of its responsibility to protect the life and property of the Nigerians”, he said.