Gunmen from the Islamist militant group al Shabaab stormed a university in Kenya and killed at least 147 people on Thursday, in the worst attack on Kenyan soil since the U.S. embassy was bombed in 1998.
The siege ended nearly 15 hours after the Somali group's gunmen shot their way into the Garissa University College campus in a pre-dawn attack, sparing Muslim students and taking many Christians hostage.
Interior Minister Joseph Nkaissery said four gunmen strapped with explosives were behind the attack, the same number that killed 67 people during the 2013 bloodbath at a shopping mall in Nairobi.
"The operation has ended successfully. Four terrorists have been killed," Nkaissery told Kenyan media.
Kenyan police chief Joseph Boinet said the attackers had "shot indiscriminately" when they entered the university compound.
Police and soldiers surrounded the campus and exchanged gunfire with the attackers throughout the day but were repeatedly repelled. At least 79 people were injured and many airlifted to Nairobi, Kenya's national disaster body said.
Al Shabaab, who carried out the deadly attack on the Westgate shopping mall in Nairobi in 2013, claimed responsibility for the raid on the campus in Garissa, a town 200 km (120 miles) from the Somali border.
The group has links to al Qaeda and a record of raids on Kenyan soil in retaliation for Nairobi sending troops to fight it in its home state of Somalia.
Al Qaeda bombed the United States embassies in Kenya and Tanzania on the same day in 1998, killing 224 people and wounding thousands of people.
The United States condemned the latest attack and offered Kenya help in fighting al Shabaab.
One image provided by a local journalist showed a dozen blood-soaked bodies strewn across a single university classroom in Garissa. But some students managed to escape unaided.
"We heard some gunshots and we were sleeping so it was around five and guys started jumping up and down running for their lives," an unnamed student told Reuters TV.
Authorities offered a 20 million shilling ($215,000) reward for information leading to the arrest of a man called Mohamed Mohamud, described as "most wanted" and linked to the attack.
Police chief Boinet said Kenya had imposed a dusk-to-dawn curfew on four regions near the Somalia border.
Tourism and religion
Al Shabaab, which seeks to impose its own harsh version of sharia law, has separated Muslims from Christians in some of its previous raids in Kenya, notably late last year in attacks on a bus and at a quarry.
Its repeated raids, together with attacks on churches by home-grown Islamist groups, have strained the cordial relations between Kenya's Muslim and Christian communities.
Having killed more than 200 people in Kenya over the past two years, Al Shabaab has also brought the tourism industry to its knees.
Thursday's attack undermined a renewed drive by President Uhuru Kenyatta to persuade foreigners the country is now safe to visit.
On Wednesday, he had urged Kenyans abroad to help attract tourists back despite the wave of militant violence, criticizing a warning from Australia of a possible attack in Nairobi and an advisory from Britain urging its citizens to avoid most coastal resorts.
Grace Kai, a student at the Garissa Teachers Training College near the university, said there had been warnings that an attack in the town could be imminent.
"Some strangers had been spotted in Garissa town and were suspected to be terrorists," she told Reuters.
"Then on Monday our college principal told us ... that strangers had been spotted in our college... On Tuesday we were released to go home, and our college closed, but the campus remained in session, and now they have been attacked."
Many Kenyans living in the crime-ridden frontier regions blame the government for not doing enough to protect its citizens from the militants.