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.
Police also recovered an unexploded suicide vest from one of the attackers, spokesman George Kinoti said in a statement.
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 has 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.
"The station caught fire. Police shot the three and killed them. Two officers are in hospital with wounds. Presumably it is a terror attack."
Two bullet-proof jackets and an unused petrol bomb were recovered from the dead suspects, Coast regional commander Nelson Marwa told reporters.
Two separate police sources who asked not to be named said a woman who had housed the suspects the night before the attack had been arrested.
Kinoti said police arrested three other people at the house of one of the attackers, saying they were her accomplices.
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.
Police did not say which group the suspects were linked to but Mohamed said the women pledged allegiance to al Shabaab.
"They shouted saying they were al Shabaab and recited the Arabic slogan 'Allahu Akbar' even as police fired bullets at them. They did not run. They shouted until bullets felled them down," she told reporters.
Somalia's al Qaeda-linked al Shabaab has claimed responsibility for attacks in Mombasa and other parts of Kenya, saying this was retaliation for Kenya sending 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 attacks in 2014 that killed more than 100 in Lamu County region.