Three robed women tricked their way into a Mombasa police station where they stabbed one officer and set fire to the building with a petrol bomb before being shot dead, an officer and a witness said on Sunday.

The city of Mombasa, with a large Muslim population on the coast of Kenya, has been targeted by Islamist militants in recent years although the frequency of attacks have subsided.

Under the pretext of reporting a stolen phone, the women walked into the police station on Saturday morning, a knife and petrol bomb concealed in their traditional Buibui robes.

"While being questioned by officers, one drew a knife and the other threw a petrol bomb at the police officers," Patterson Maelo, Mombasa County Police Commander, told reporters at the scene.

"The station caught fire. Police shot the three and killed them. Two officers are in hospital with wounds. Presumably it is a terror attack."

Maelo did not say which group he suspected the attackers belonged to.

Salma Mohamed, a witness who was at the station to see a relative in custody, said one attacker had jumped onto a counter and stabbed an officer in the thigh before being shot.

Somalia’s al Qaeda-linked al Shabaab has taken responsibility for attacks in Mombasa and other parts of Kenya, saying it was in retaliation for the East African country sending its troops to Somalia.

Al Shabaab was behind an attack on Nairobi’s Westgate shopping mall that killed 67 people and a raid on Garissa university in the northeast that killed 148. The militants also launched several attacks in 2014 that left more than 100 dead in Lamu County region.

(Reporting by Joseph Akwiri; Writing by George Obulutsa; editing by Susan Thomas)