Women, children among those released, but dozens of others taken in a separate incident are still missing.
Attackers have stormed a primary school in the northwestern Nigerian state of Kaduna and seized three teachers but no children, according to a state official.
The raid by the motorcycle-riding gunmen on Monday was the latest in a series of attacks targeting schools in Nigeria, coming just days after nearly 40 students were kidnapped by a gang.
Samuel Aruwan, Kaduna state’s commissioner for internal security, said in a media briefing that Rema Primary School, in the Birnin Gwari Local Government Area, was attacked at about 8:50am (07:50 GMT).
He said children fled as the attackers, referred to locally as bandits, entered the compound shortly after pupils arrived.
“This led to two pupils going missing. We are happy to inform you that the two missing pupils have been found,” Aruwan said. “We can also confirm that no single pupil was kidnapped from the school.
“The government can confirm that three teachers … have been kidnapped.”
Aruwan had earlier said an unspecified number of pupils and teachers were kidnapped.
The latest kidnapping is the fifth mass school abduction since December.
Gunmen abducted 39 students late on Thursday from hostels on the outskirts of Kaduna city, the state capital. On Monday, the authorities shut down their college and sent home 180 other students and staff who had been rescued.
At the weekend, security forces thwarted a gang that had stormed a secondary school in Ikara.
“The number of abductions in the north is just mind-boggling,” said Al Jazeera’s Ahmed Idris, reporting from Nigeria’s capital, Abuja. “It’s becoming the most lucrative criminal enterprise in Nigeria today – and it’s growing fast.”
Between June 2011 and March 2020, at least $18m was paid to kidnappers as ransom, according to a report by SB Morgen.
The trend of abduction from boarding schools was started by the armed group, Boko Haram, which seized 270 girls from a school in Chibok in the northeast in 2014. About 100 of them were never found. Armed criminal gangs seeking ransom have since carried out copycat attacks.
Attempts by the military and police to tackle the gangs have had little success, while many worry state authorities are making the situation worse by letting kidnappers go unpunished, paying them off or providing incentives.
The unrest has become a political problem for President Muhammadu Buhari, a retired general and former military ruler who has faced mounting criticism over the rise in violent crime and replaced his longstanding military chiefs earlier this year.