The number of people killed by al-Shabab militants in an attack on a university in north-eastern Kenya has risen to 147, government officials say.
The operation to secure the Garissa University College campus was now over, with all four attackers killed, they added.
Some 587 students escaped, 79 of whom were injured.
The gunmen were wearing suicide vests, according to reports, and were armed with AK-47s.
Interior Minister Joseph Nkaissery said the militants exploded "like bombs" as the siege ended, according to the Associated Press. Some officers were wounded by shrapnel.
It is not clear if the attackers deliberately detonated the explosives as police approached, or if they went off automatically after being hit by gunfire.
An overnight curfew is being implemented in parts of the country.
Four counties near the Kenya-Somalia border, Garissa, Wajir, Mandera and Tana River, would have dusk-to-dawn curfews imposed, disaster management officials said.
Nine critically injured students were airlifted to the capital Nairobi for treatment, they added.
But each student had been accounted for by the end of the evacuation.
Attack as it happened
Masked gunmen stormed the university early on Thursday morning and took hostages.
- Militants enter the university grounds, two guards are shot dead
- Shooting begins within the campus
- Students attacked in their classrooms while preparing for exams
- Gunmen believed isolated in the female dormitories
- Some students make an escape through the fence
UN Secretary-General Ban Ki-moon condemned what he called a "terrorist attack" and said the UN was ready to help Kenya "prevent and counter terrorism and violent extremism".
The United States said it was offering Nairobi assistance to take on al-Shabab and would continue to work with others in the region to take on the group.
The Kenyan government has named Mohamed Kuno, a high-ranking al-Shabab official, as the mastermind of the attack.
A BBC Somali Service reporter says Mr Kuno was headmaster at an Islamic school in Garissa before he quit in 2007.
Kenyan President Uhuru Kenyatta offered his condolences to families of the victims and ordered "urgent steps" to ensure police recruits could begin training immediately. "We have suffered unnecessarily due to shortage of security personnel," he said.
'Shot on the spot'
Earlier, al-Shabab told the BBC its members were holding Christians hostage and freeing Muslims.
The gunmen reportedly ordered students to lie down on the floor, but some of them escaped.
Student Augustine Alanga told the BBC's Newsday programme: "It was horrible, there was shooting everywhere."
He said it was "pathetic" that the university was only guarded by two police officers.
Student Collins Wetangula said when the gunmen entered his hostel he could hear them opening doors and asking if the people inside were Muslims or Christians, the AP news agency reports.
"If you were a Christian you were shot on the spot. With each blast of the gun I thought I was going to die," he said.
Al-Shabab says it attacked the university because it is at war with Kenya, BBC Africa analyst Mary Harper reports.
Kenyan troops entered Somalia in October 2011 in an effort to stop the Islamists from crossing the long, porous border between the two countries and kidnapping people - but their presence achieved the opposite effect, provoking al-Shabab to increase its activity in Kenya, our correspondent adds.