An armed group with AK-47s, stormed the Government Science secondary school in Kankara district which led to a shootout between the gunmen and security forces.
Gunmen have raided a government secondary school in northern Nigeria's Katsina state, police said, in an apparent kidnapping attempt for ransom.
Local residents said that several students were captured.
President Muhammadu Buhari condemned the attack in a statement on Saturday and ordered security reinforcement in other schools.
The gunmen stormed Government Science Secondary School at Kankara late Friday.
Exchange of fire
"The bandits came on motorcycles firing sporadically and tried to enter the school," said state police spokesman Isa Gambo.
"Our men with the assistance of the army engaged them in a shootout lasting one and a half hours."
The gunmen were forced to retreat and were being tracked, but the spokesman made no mention of casualties.
"We are still taking the roll call to determine if any student is missing," he told AFP.
Reinforcements had been deployed to search for any missing students.
"This morning some 200 students who fled for safety during the assault have returned to the hostel," he added.
The police said an inspector was injured and was receiving treatment.
Kidnapping for ransom
Local residents said several students were kidnapped by the attackers who split into two groups.
"The kidnappers fought with security personnel. While the fighting was ongoing another group went into the school and took away several students," Nura Abdullahi told AFP.
"Some of the students who escaped returned to the town this morning but others took a bus home," he said.
"The school is deserted. All the students have vacated," he added.
Another resident, Ibrahim Mamman, added that most of the students had escaped, "but some were captured and taken away by the bandits".
"Nobody can say how many students were abducted because there has not been a headcount," he said.
Local media reported that scores of students might have been abducted.
Buhari on Saturday urged security forces to arrest the gunmen.
"I strongly condemn the cowardly bandits' attack on innocent children at the Science School, Kankara. Our prayers are with the families of the students, the school authorities and the injured," he said.
Katsina, Buhari's home state, is among several in northwest Nigeria that have been repeatedly attacked by "bandits" who kidnap for ransom and rustle cattle.
In August, seven students were kidnapped along with their female teacher from a private secondary school in nearby Kaduna state.
The hostages were later released, but it was not revealed if a ransom was paid.