Story highlights Man stabbed a police officer in the head before being shot

Attacker was a Kenyan national, police say

Nairobi, Kenya (CNN) A police officer shot and killed a man who stabbed him as he stood guard outside the US Embassy in Nairobi Thursday, authorities said.

"The officer fired back in self-defense and managed to kill (the attacker). My officer is in hospital in a stable condition. The victim died on the spot," Vitalis Otieno, the Gigiri division commanding officer of the Nairobi Police, told CNN.

The man killed was a Kenyan national, police said, but they are not releasing his name while the case is under investigation. His motive was not immediately clear.

The officer was stabbed in the head, Otieno said. Further details about the officer's injury weren't immediately available.

The US Embassy confirmed that a shooting had taken place outside its premises and said none of its staff members were involved.

Read More