The released group included 27 students, teachers and family members, the state government said in a statement at the time of the kidnapping.
The gunmen, wearing military fatigues according to witnesses, stormed the Government Science Secondary School Kagara on February 17. A student who died during the attack was named as Benjamin Habila.
The executive governor of Niger State, Abubakar Sani Bello, tweeted that those released have been received by the state government.
This comes as hundreds of schoolgirls were abducted in the early hours of Friday when armed men raided a state-run school in Zamfara State, northwest Nigeria.
The schoolgirls were taken from their hostels by gunmen who raided the Government Girls Secondary School in the town of Jangebe, a high-ranking government official with knowledge of the incident told CNN.