The storming of Garissa University College by militants is the worst attack on Kenyan soil since the 1998 US embassy bombing by al-Qaeda – 147 people have died and 79 have been wounded, some critically.
It follows repeated attacks inside Kenya by al-Shabab, which is affiliated to al-Qaeda.
The most audacious al-Shabab raid was on Westgate shopping centre in Nairobi in September 2013, when 62 civilians from 13 countries were among the 67 who died in a four-day siege.
BBC Somalia specialist Mary Harper looks at the tactics of the Islamist group, which controls rural areas of southern Somalia.
Why was Kenya attacked?
Al-Shabab says it has been at war with Kenya ever since Kenyan forces entered Somalia in October 2011 in an effort to crush the militants.
The government wanted to stop the militants from crossing the long, porous border between the two countries and kidnapping people – which was affecting tourism.
But the move provoked al-Shabab, which says Kenyan civilians are legitimate targets because they voted for the government that declared war on the group.
Does al-Shabab have Kenyan recruits?
Al-Shabab is recruiting an increasing number of Kenyans, from both Somali and non-Somali populations.
The security forces’ targeting of disadvantaged Muslims, whom they accuse of violent radicalism, has pushed some into militancy.
Recent al-Shabab propaganda films feature non-Somali fighters speaking Kiswahili, which is widely spoken in Kenya, and not in Somalia.
There are also unconfirmed reports that it is considering switching allegiance to Islamic State in order to remain relevant.
How is Kenya dealing with the fight against terror?
Kenya has received international help, especially since the Westgate attack, as it is seen as a key ally in the “war on terror”.
Security has been beefed up, but the Kenyan police and military often fail to work together effectively.
At times, including at the university in Garissa, intelligence about possible attacks is not followed through with extra security deployments.
Can Kenya overcome these tensions?
Attacks by al-Shabab, especially those which only target non-Muslims, risk increasing religious tensions in Kenya.
They also lead to more prejudice against ethnic Somalis, whether they are Kenyan citizens or refugees or migrants from Somalia. Kenya has nearly 500,000 refugees, many of whom fled decades of conflict and drought in Somalia.
The more Somalis feel alienated in Kenya, the greater the likelihood some will sympathise with al-Shabab.