The form four student found with a pistol at a Homa Bay school was arraigned on Wednesday.
The learner of Orero Boys' High School in Rangwe constituency was found with the weapon on Tuesday afternoon after his colleagues raised the alarm.
The student appeared before principal magistrate Susan Ndegwa who deferred the plea to September 17 following a request by the prosecution.
Prosecutor Valarie Ongeti said they need to establish his age so they know whether he can be tried.
The charge sheet presented in court says the learner had a HK45 pistol, serial number 25094705.
He was taken to Homa Bay police station and the weapon to the Rangwe station.
Area OCPD Esau Ochorokodi earlier told journalists the student brandished the gun forcing students to alert the administration.
School principal Dickens Bula said some of his schoolmates told them they were afraid.
Ochorokodi said the student had denied having the firearm but later admitted to the offence after police interrogated him.
“He took police officers to a nearby bush where he had hidden the weapon."
The police boss said they examined the pistol and found it was of the American type and that it was not licensed for use in Kenya.
The student said he got it from a relative who lived in the United States but is now a director at the Jaramogi Oginga Odinga university in Siaya county.
Ochorokodi said the gun had no bullet.