Baragoi Secondary School was closed indefinitely on Tuesday amid rising tension following the killing of a teacher.
Its 135 students and all teachers were ordered to leave, with fears that the surrounding communities could launch retaliatory attacks.
Samburu County Commissioner Henry Wafula said the security team decided to close down the school temporarily to keep learners and teachers safe.
Mr Wafula told the Nation that teachers and students were left in fear and panic because of what he described as an isolated incident.
The attack also caused panic in Samburu North region.
"We decided to temporarily suspend learning operations so that tension is relieved. We are going to open the school as soon as possible, preferably at the end of the week," Mr Wafula said.
He said officers drawn from the General Service Unit (GSU), Administration Police (AP) and Rapid Deployment Unit (RDU) had been deployed to quell violence and possible retaliation.
The attack has raised fears about cohesion in the region's fragile tribal patchwork just as Kenya is preparing for elections on August 9, less than two weeks away.
Mr Wafula said the government was combatting banditry in the region. He added police were investigating the motive of the murder of the teacher, Cyrus Kirukura.
"We are planning peace meetings together with local leaders in the region to neutralise bandit activities and we call on the public to support our efforts," he added.
The Kenya Union of Post-Primary Education Teachers (Kuppet) wants its members serving in banditry-prone areas of Baragoi to be withdrawn immediately following the chilling murder of the youthful teacher.
Samburu County Kuppet executive secretary William Lenkoyiap issued an ultimatum to the government to address runaway insecurity and advised teachers to keep away from schools until their safety is guaranteed by the state.
He noted that the lives of teachers working in Baragoi are at a high risk as sporadic attacks continued in the region.
"As teachers, we condemn the act with the strongest terms possible. On this we demand that teachers from these danger zones of Baragoi be evacuated with immediate effect," Mr Lenkoyiap said in a statement.
“We cannot risk our teachers working in these hostile areas."
The unionist also asked teachers in the area to leave as they await further directions from the union's national office and their employer, the Teachers Service Commission (TSC).
Mr Lenkoyiap noted that Baragoi is the most dangerous area one can work in, and the deaths of more than 42 national police officers mirrors the volatility index of Baragoi.
He also asked Interior Cabinet Secretary Fred Matiang'i to give a way forward for teachers working in the volatile region.
"Baragoi is a very dangerous area, where we lost over 40 armed police officers from the same group of criminals who have taken the law into their hands,” Mr Lenkoyiap said.
“This shows the magnitude of the situation, ability and preparedness of these criminals."
He eulogised Mr Kirukura as a young and hardworking person who was passionate about his profession.
"The brutal hand of characters who adhere to no law has robbed us of a hardworking English and literature colleague," he said.
Mr Kirukura was killed on his way to a hospital when the attackers sprayed him with bullets.
Baragoi High Principal Elijah Letakai said the teacher was killed just 200 metres from the school's main gate, a few minutes after midday. He was going to a hospital in Baragoi because he was feeling unwell.
He had reported for duty on Monday morning but started complaining of aches and sought permission to go seek treatment.
Since the early 2000s, the school's academic performance has been affected by endemic insecurity in Baragoi. Enrolment had also dropped drastically and parents had started withdrawing their children from the school, fearing for their lives.
In 2015, a watchman at the school was shot dead by unknown gunmen near the gate in the evening as he stepped out to go home. He was also a police reservist.