NAIROBI, Kenya -- Somali militants burst into a university in eastern Kenya on Thursday and killed nearly 150 students in the worst terrorist attack since the 1998 bombing of the U.S. Embassy here, laying bare the nation's continuing vulnerability after years of battling Islamist extremism.
A small group of militants, most likely between four and 10, roved dorm to dorm, separating Christian from Muslim students and killing the Christians, the authorities said. Students described being awakened before dawn by the sound of gunfire and fleeing for their lives as masked attackers closed in.
Officials said that by the time Kenyan commandos cornered and killed the attackers on an upper floor, 147 people lay dead.
Despite new security laws, significant Western help and a heightened state of vigilance that has already put police officers on almost every major street corner in the capital, Nairobi, Kenya remains squarely in the crosshairs of al-Shabab, the Somali terrorist group that immediately claimed responsibility for the attack on Thursday.
Al-Shabab has killed hundreds of Kenyans - on country buses, in churches, in remote coastal towns and inside one of Kenya's fanciest malls during a devastating siege in 2013 that left 67 people dead and rattled Kenya's prized image as a cornerstone of stability in this part of Africa.
The Kenyan government is so desperate to stop al-Shabab, one of the most violent franchises of al-Qaida, that some officials have even proposed building a 424-mile wall along the entire Somali border.
Kenya's tourist industry, one of the pillars of its economy, has been badly damaged by the terrorist attacks and the bloodshed on Thursday is sure to make things worse. There are also fears that al-Shabab's relentless emphasis on singling out Christians could inflame religious strife in a country already wrestling with tensions between a Muslim minority, which has complained about government persecution, and a Christian majority that increasingly feels under attack.
The violence Thursday came just days after President Barack Obama announced that he would visit Kenya in July, his first trip to his father's homeland since taking office. Obama had stayed away until now, at least in part out of concerns about Kenya's public safety.
The White House issued a statement condemning the attack and vowing to continue assisting Kenya in fighting al-Shabab - in recent months, the U.S. military has killed the group's leader and other operatives - but it offered no indication whether the university siege would change Obama's travel plans.
The Kenyan authorities said that around dawn the attackers stormed Garissa University College in Garissa town, about 90 miles from the Somali border. Though the college is in a predominantly ethnic Somali area of Kenya, it attracts students from across the country, many of them non-Muslim.
In a statement early on Thursday, al-Shabab said that its fighters had attacked the university early in the morning, separating Muslims from non-Muslims in an "operation against the infidels."
In an audio message soon after, an al-Shabab spokesman, Ali Mohamoud Raghe, said the attack had been carried out because "the Christian government of Kenya has invaded our country," a reference to the Kenyan military's 2011 incursion into Somalia to oust al-Shabab from its strongholds.
He said the university had been targeted because it was educating many Christian students in "a Muslim land under colony," a reference to the large Somali population in a part of Kenya that Somalia once tried to claim. He called the university part of Kenya's "plan to spread their Christianity and infidelity."
President Uhuru Kenyatta vowed to crack down on terrorists and on Thursday he abruptly ordered 10,000 police recruits to report to duty despite a court order saying the recruits may have been selected through corrupt practices. Human rights observers have said that Kenyatta is trying to consolidate control and using the fear of terrorism to quash civil rights.
On Thursday, panicked students streamed out of the besieged university with chilling stories of witnessing their classmates being killed. Augustine Alanga, 21, an economics student, said he had been asleep in his dormitory when the shooting began. He said he bolted from his room without stopping to put on his shoes, cutting his feet as he sprinted barefoot across the campus and into a nearby forest.
"When I looked back, I saw them," Alanga recalled. "There were five or six of them. They were masked. And they were shooting live rounds."
The authorities said that the attack began when the gunmen killed two guards standing by the main gate of the university.
Nearby police officers "heard the gunshots and responded swiftly, and engaged the gunmen in a fierce shootout; however, the attackers retreated and gained entry into the hostels," a police statement said. "Security agencies arrived and are currently engaged in an elaborate process of flushing out the gunmen."
The police surrounded and sealed off the campus, and by 11 a.m., three of the college's four student dormitories had been evacuated, while "the attackers have been cornered in one hostel," the Interior Ministry said on Twitter.
Kenya's struggles with al-Shabab have been going on for years. In late 2011, citing a string of attacks and kidnappings in its country, the Kenyan military charged across the border into Somalia, sending troops, tanks and aircraft to fight al-Shabab.
The military later acknowledged that the invasion had been planned well in advance, part of an effort to protect Kenya's borders from the violence in Somalia and to safeguard Kenya's economic interests, including a huge port to be built just 60 miles south of Somalia.
The incursion managed to dislodge al-Shabab from vital positions, but instead of pushing the al-Shabab threat farther from Kenya, it did the opposite: it brought more al-Shabab in.
Its attacks on Kenya since 2011 have grown in scope and lethality. Many people thought it could not get worse than the siege on the Westgate shopping mall in Nairobi, a gleaming symbol of Kenya's modernity, wealth and relative peace. The attack on Thursday was by far the deadliest in Kenya since al-Qaida agents blew up the U.S. Embassy in Nairobi in 1998, killing more than 200, the vast majority of them Kenyans.
Al-Shabab began trying to affiliate with al-Qaida as early as 2009, but Osama bin Laden kept them at arm's length when he was alive, and internal documents have revealed that he was uneasy about the group's murderous tactics, including the indiscriminate killing of Muslim civilians. Al-Shabab did not become an official branch of al-Qaida until February 2012, almost a year after bin Laden's death.
Since then, the group has maintained that it tries to minimize Muslim casualties, though Muslims continue to be targets in many of their operations. During the shopping mall attack, gunmen separated Muslim from non-Muslim civilians by asking religious trivia questions ("What is the name of the Prophet's mother?" "What is the name of his first wife?") The "nonbelievers" were killed on the spot.
In an al-Shabab document that was found in Mali by The Associated Press, the group tried to justify its tactics, saying that "all Muslims must stay far away from the enemy and their installations so as not to become human shields for them" and that there was "no excuse for those who live or mingle with the enemies."