President William Ruto said he had asked authorities to investigate and hold those responsible to account.
More rescuers were on their way to the Hillside Endarasha Academy in Nyeri, the spokeswoman, Resila Onyango, said in a broadcast on Kenya's Hot 96 FM radio, and authorities would provide details later.
"We have lost 17 pupils in the fire incident while 14 are injured ...," Onyango told Reuters by telephone. "Our team is at the scene at the scene at the moment."
The fire had burnt the students beyond recognition, Citizen Television said earlier.
"I instruct relevant authorities to thoroughly investigate this horrific incident. Those responsible will be held to account," Ruto said in a post on his X account
Authorities have cordoned off the school, Kenya Red Cross said on X.
There have been a series of school fires in Kenya in recent years, many of them which have turned out to be arson.
Nine students were killed in Sept 2017 in a fire at a school in the capital, Nairobi, that the government attributed to arson.
In 2001, 58 schoolboys were killed in a dormitory fire at Kyanguli Secondary School outside Nairobi. In 2012, eight students were killed at a school in Homa Bay County in western Kenya.