Seven police officers among the dead after gunmen attacked a bus in northeast Kenya, local media reported.

At least 10 people, including several police officers, have been killed when gunmen attacked a bus in northeast Kenya.

The vehicle belonging to the Medina Bus Company was attacked on Friday on a lonely stretch of road in the Kotulo area as it travelled between the towns of Wajir and Mandera, close to the border with Somalia.

“People, among them police officers, were brutally murdered,” President Uhuru Kenyatta’s office said in a statement on Saturday.

The Somalia-based al-Shabab armed group, which has also carried out a number of attacks in neighbouring Kenya, took responsibility for the assault, saying it had killed people that included “secret security agents and government employees”.

Police said 10 people had been killed and that the attackers had specifically targeted non-Somalis after flagging down the bus. The area is mostly inhabited by ethnic Somali Kenyans.

Seven police officers were killed in the attack, local media reported. A security source gave the same figure to the AFP news agency.

Witnesses said the attackers had shot all the victims outside the bus at close range, but police and the government did not comment on those accounts.

Al-Shabab has been fighting for more than 10 years to overthrow successive internationally-backed Somali governments and has previously attacked many vehicles.

Although Somalia is slowly rebuilding after years of devastating conflict, it suffers regular bombings and assaults claimed by the group.

Al-Shabab’s fighters were driven out of Mogadishu by government forces backed by 20,000 African Union peacekeepers in 2011.

Kenya has often been targeted by al-Shabab, which killed 67 people at Nairobi’s Westgate shopping centre in 2013 and nearly 150 students at Garissa University in 2015.

Al-Shabab says its attacks are revenge for Kenyan troops stationed inside Somalia.

In June, it took responsibility for a roadside bomb attack in Kenya’s Wajir county that killed at least eight police officers.