At least 147 people have been killed after Kenyan troops cleared a university dormitory in the town of Garissa in northeast Kenya that had been seized by al-Shabab gunmen, the interior ministry says.
Members of the Somalia-based group attacked the campus after dawn on Thursday and were holed up in a dormitory with hostages until the evening.
Officials said 79 students had been injured in the attack, and 587 had been evacuated.
Security forces had encircled the building exchanging sporadic bursts of gunfire with the fighters inside, who were believed to have been holding scores of students hostage.
Witnesses told Al Jazeera they heard heavy gunfire and saw smoke coming from the campus on Thursday evening as the standoff came to an end.
Joseph Nkaissery, the interior minister, said four attackers had strapped themselves with explosives.
A female student who escaped the hostage drama told Al Jazeera that she had stepped over more bodies than she could count as she got out of the university.
Al Jazeera's Malcolm Webb, reporting from Garissa, said security officials were now working on identifying bodies and moving them to the morgue.
The attack was the worst in Kenya since the 1998 bombing of the US embassy in Nairobi by al-Qaeda, when 213 people were killed by a huge truck bomb.
In 2013, al-Shabab claimed responsibility for the attack on the Westgate mall that left 67 people dead.
The masked gunmen then stormed the university as students were sleeping in their dormitories, shooting dead dozens before taking hostages. Al-Shabab said it had set Muslims free and captured Christians.
The al-Qaeda-linked group said the assault was launched in revenge for Kenya sending troops to fight al-Shabab in Somalia.
Kenya's President Uhuru Kenyatta said the lack of security infrastructure had contributed to the crisis.
"We have suffered unnecessarily due to a shortage of security personnel. Kenya needs additional officers, and I will not keep the nation waiting," he said.
After the attack, the country's interior ministry announced a 12-hour curfew starting at 6.30pm in Garissa, Wajir, Mandera, and Tana River counties.