Kenyan police officers were among eight people killed when gunmen suspected to be from Somalia's al Shabaab Islamist militant group attacked a passenger bus on Friday evening, President Uhuru Kenyatta's office said on Saturday.

Israel bus attack
Al Shabaab said it had carried out the attack and that it had killed 10 people including "secret security agents and government employees".Instagram/Ben Hartman [Representational]

The vehicle, belonging to the Medina Bus Company, was attacked 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.

"Eight people, among them police officers, were brutally murdered," Kenyatta's office said in a statement.

Al Shabaab said it had carried out the attack and that it had killed 10 people including "secret security agents and government employees".

The group has targeted Kenya many times since the East African nation sent troops across the border to fight the militants in their homeland in October 2011.

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.