More than 300 school children kidnapped by armed men in northwest Nigeria last week have been rescued, The Independent reported Friday, quoting government officials.

The boys, whose abduction was claimed by Islamist militant group Boko Haram, were headed back to Katsina, Gov. Aminu Masari said Thursday. But some boys remain unaccounted for, the governor told Nigeria's state broadcaster NTA.

The release comes after armed men stormed the Government Science Secondary School in Kankara last week, which had more than 800 students. "I think we can say at least we've recovered most of the boys, if not all of them," Masari said.

Security forces sealed off the area where the students were being held and ordered them not to fire a single shot, the governor said.

The government will now work with law enforcement authorities and engage private security companies to safeguard schools and prevent the "ugly experience of the last six days" from happening again, Masari said.

Nigeria President Muhammadu Buhari welcomed the students' release, calling it "a big relief to their families, the entire country and to the international community," The Associated Press quoted the president as saying.

A video circulated on social media moments before news of the release was made public showed some of the hundreds of abducted school children with Boko Haram.

The video showed a distressed teenager surrounded by a large group of boys saying he was among 520 students abducted by a gang called "Abu Shekau."

Authorities believe the video is authentic, but they cannot independently confirm its authenticity, the identity of the students on the footage, or who released it.

Boko Haram carried out the school attack because it believes Western education is "un-Islamic," group leader Abubakar Shekau said in a video earlier this week.