The gunmen divided students at the northeastern Garissa University between Muslims and non-Muslims, letting the Muslim students go, insurgent spokesman Sheikh Ali Mohamud Rage told AFP by telephone.
"Kenya is at war with Somalia... Our people are still there, they are fighting and their mission is to kill those who are against the Shebab," Rage said.
"When our men arrived, they released some of people, the Muslims, and it is they that alerted the government... We are holding the others hostage," he said, adding those seized were Christians, but not saying how many there were.
He did not give details on the number of casualties but said "there are very many."
The Kenya Red Cross which is leading the medical response to the attack said there were "an unknown number of student hostages" although "50 students have been safely freed".
At least two people were killed and 30 suffered gunshot wounds.
At midday, Kenyan troops had surrounded the campus, with the interior ministry saying that the "attackers have been cornered in one hostel."
On March 27 the Somali extremist group Al Shebab have released a new video, showing civilians being forced into the sea and murdered in a hail of gunfire.
Entitled 'In Remembrance 2', the video show Al-Shebab coldly executing civilians with machine guns before leaving the bodies to rot on the beach.