NAIROBI, Kenya — Seven girls died early Saturday when a fire gutted their dormitory at a high school in Kenya’s capital, Nairobi, the country’s education minister said.

The cause of the fire was not immediately known, the minister, Fred Matiangi, said. Moi Girls High School will be closed for two weeks for an investigation.

“At 2 a.m., our matron came, telling us to get out of the hostel because there was fire in one of the hostels,” Warda Sadique, a student, said. “So most of the people were panicking. Some were jumping through the windows.”

President Uhuru Kenyatta and the opposition leader, Raila Odinga, expressed their concern over the deaths. Both are returning to campaigning after a Supreme Court ruling on Friday nullified the results of last month’s election.