Four boys, two girls and a night guard died at Lokichogio Secondary school in kenya, about 120 miles from the border with South Sudan.
The suspect, aged 17, had been suspended last week for fighting and had vowed to take revenge.
He was arrested while allegedly attempting to flee into the Kakuma refugee camp following the
early morning shooting, which injured 20 people.
However, angry members of the public killed him after overpowering police.
"The school was not attacked by bandits but an errant student on expulsion for disciplinary cases," regional government official Wanyama Musyambohe told reporters.
Turkana County commissioner Seif Matata was quoted by the Daily Nation as saying: "There was a student who comes from South Sudan and he was suspended from school because of indiscipline.
"He was heard telling fellow students that he was going to burn the school or he will come back and avenge because of the suspension."
POSTED: KENYA