'Muslims were allowed go free but Christians were shot on the spot'
A spokesman for al-Shabaab last night said that the group carried out the attack.
"We've killed many people. Kenyans will be shocked when they go inside," he was quoted by the BBC as saying.
Witnesses told how they released Muslim students and shot Christians.
One student who witnessed the attack said he could hear militants opening doors and asking those hiding inside if they were Muslim or Christian.
"If you were a Christian, you were shot on the spot," he said.
"With each blast of the gun, I thought I was going to die." In a speech to the nation President Kenyatta Uhuru confirmed the slaughter: "I am saddened to inform the nation that, early today, terrorists attacked Garissa University College, killed and wounded several people and have taken others hostage."
A policeman at the scene earlier said he had counted 14 bodies being carried out of the campus by a Red Cross Ambulance. "They include two of our officers who were also killed," he said.
"We are finding it difficult to access the compound because some of the attackers are on top of a building and are firing at us whenever we try to enter."
One student who fled described chaotic scenes as gunmen burst into the building. "They are just shooting randomly," he said.
"My life was in danger, in fact everybody's. They were shooting at us with live bullets, everywhere, all over the school compound.
"I am trying to call [students still trapped inside] but I can't reach anyone." Two of the fatalities were guards at the university gates.
The US Embassy in Nairobi condemned the shooting as a "terrorist attack" on its official Twitter feed.