GARISSA, KENYA—Al Shabab gunmen rampaged through a university in northeastern Kenya at dawn Thursday, killing 147 people in the group’s deadliest attack in the East African country. Four militants were slain by security forces to end the siege just after dusk.

The masked attackers — strapped with explosives and armed with AK-47s — singled out non-Muslim students at Garissa University College and then gunned them down without mercy, survivors said. Others ran for their lives with bullets whistling through the air.

Amid the massacre, the gunmen took dozens of hostages in a dormitory as they battled troops and police before the operation ended after about 13 hours, witnesses said.

MORE ON THESTAR.COM:

When gunfire from the Kenyan security forces struck the attackers, the militants exploded “like bombs,” Interior Minister Joseph Nkaissery said. The shrapnel wounded some of the officers.

Al Shabab spokesman Ali Mohamud Rage said fighters from the Somalia-based extremist group were responsible.

The Al Qaeda-linked group has been blamed for a series of attacks in Kenya, including the siege at the Westgate Mall in Nairobi in 2013 that killed 67 people, as well as other violence in the north.

The group has vowed to retaliate against Kenya for sending troops to Somalia in 2011 to fight the militants staging cross-border attacks.

Most of the 147 dead were students, but two security guards, one policeman and one soldier also were killed in the attack, Nkaissery said.

At least 79 people were wounded at the campus 145 kilometres from the Somali border, he said. Some of the more seriously wounded were flown to Nairobi for treatment.

A dusk-to-dawn curfew was ordered in Garissa and three nearby counties.

One suspected extremist was arrested as he tried to flee, Nkaissery told a news conference in Nairobi.

Police identified a possible mastermind of the attack as Mohammed Mohamud, who is alleged to lead Al Shabab’s cross-border raids into Kenya, and they posted a $220,000 bounty for him. Also known by the names Dulyadin and Gamadhere, he was a teacher at an Islamic religious school, or madrassa, and claimed responsibility for a bus attack in Makka, Kenya, in November that killed 28 people.

One of the survivors of Thursday’s attack, Collins Wetangula, told The Associated Press he was preparing to take a shower when he heard gunshots coming from Tana dorm, which hosts both men and women, 150 metres away. The campus has six dorms and at least 887 students, he said.

When he heard the gunshots, he locked himself and three roommates in their room, said Wetangula, who is vice-chair of the university’s student union.

“All I could hear were footsteps and gunshots. Nobody was screaming because they thought this would lead the gunmen to know where they are,” he said.

He added: “The gunmen were saying, ‘Sisi ni Al Shabab’ — Swahili for ‘We are Al Shabab.’ ”

He heard the attackers arrive at his dormitory, open the doors and ask if the people who had hidden inside were Muslims or Christians.

Loading... Loading... Loading... Loading... Loading... Loading...

“If you were a Christian, you were shot on the spot,” he said. “With each blast of the gun, I thought I was going to die.”

The gunmen then started shooting rapidly, as if exchanging fire, Wetangula said.

“The next thing, we saw people in military uniform through the window of the back of our rooms who identified themselves as the Kenyan military,” he said. The soldiers took him and around 20 others to safety.

The attack began about 5:30 a.m., as morning prayers were underway at the university mosque, where worshippers were not attacked, said Augustine Alanga, a 21-year-old student.

At least five heavily armed, masked gunmen opened fire outside his dormitory, turning intense almost immediately and setting off panic, he told the AP by telephone.

The shooting kept some students indoors but scores of others fled through barbed-wire fencing around the campus, with the gunmen firing at them, he said.

“I am just now recovering from the pain as I injured myself while trying to escape, Alanga said. I was running barefoot,” Alanga said.

Three dorms were evacuated as the gunmen holed up in a fourth, and Kenyan Defence Forces surrounded the campus.

“I am saddened to inform the nation that early today, terrorists attacked Garissa University College, killed and wounded several people, and have taken others hostage,” President Uhuru Kenyatta said in a speech to the nation while the siege was underway.

UN Secretary-General Ban Ki-moon condemned the attack, reiterating his solidarity with the Kenyans “to prevent and counter terrorism and violent extremism,” his office said.

Kenya’s northern and eastern regions near the Somali border have seen many attacks blamed on Al Shabab.

Last month, Al Shabab claimed responsibility for attacks in Mandera county on the Somali border in which 12 people died. Police said Al Shabab attacks have killed 312 people in Kenya from 2012 to 2014.

Last week, Al Shabab claimed responsibility for a siege at a Mogadishu hotel that left 24 people dead, including six attackers.