Orders were given for many schools to close in the states of Kebbi, Niger, Katsina, Yobe and Kwara.
News of the children’s escape brought welcome relief for families and for a country that has been agonising over the fate of hundreds of schoolchildren abducted in Nigeria’s northwest.
According to a Christian group involved in the case, the pupils managed to escape between Friday and Saturday in what is being described as a brave and risky attempt to flee their captors.
The students and teachers were taken from St Mary’s School in Papiri, Niger state. earlier reports spoke of 303 students and 12 teachers being taken.
Their number surpasses the 276 abducted during the infamous Chibok mass abduction of 2014.
Local police say armed men stormed St Mary’s at around 02:00 (01:00 GMT), abducting students staying there.
Niger state governor Mohammed Umaru Bongo announced on Saturday that all schools in the area would close, warning that was “not a time for blame game”.
Dominic Adamu, whose daughters attend the school but were not taken, told the BBC: “Everybody is weak… It took everybody by surprise.”
One distressed woman tearfully told the BBC that her nieces, aged six and 13, had been kidnapped, adding: “I just want them to come home.”
The military, police and local vigilantes are conducting a search for the children, combing nearby forests and remote routes believed to have been used by the gunmen.
Authorities in Niger state said St Mary’s School had disregarded an order to close all boarding facilities following intelligence warnings of a heightened risk of attacks. The school has not commented on that allegation.
The kidnapping of people for ransom by criminal gangs, known locally as bandits, has become a major problem in many parts of Nigeria.
The payment of ransoms has been outlawed in an attempt to cut the supply of money to the criminal gangs, but it has had little effect.
On Monday, more than 20 schoolgirls, who the BBC has been told are Muslim, were kidnapped from a boarding school in Kebbi state.
Authorities there have now ordered all secondary schools and colleges to close.
A church was also attacked further south in Kwara state, with two people killed and 38 others abducted.