Officers patrol outside a police station in Mombasa, Kenya, on Sunday, following a knife and bomb attack by three women. (Agence France-Presse via Getty Images)

Three women who, according to police, were armed with a gasoline bomb were shot dead Sunday morning in Mombasa’s central police station.

The women walked into the station under the pretext of reporting a stolen phone. They had concealed a knife and the bomb in their clothing.

While police officers were questioning them about the particulars of the stolen phone, said Patterson Maello, the police commandant of Mombasa County, one of the women drew the knife while another threw the bomb at police station personnel. “Police reaction led to the three being shot,” Maello said.

A witness, Salma Mohamed, a resident of Mombasa County who was at the station when the women walked in, said that a police officer was stabbed twice before the women were killed.

The women were shouting, “Allahu akbar” — Arabic for “God is great” — Mohamed said.

Two officers were taken to the hospital with injuries.

Two bulletproof jackets and an unused gasoline bomb were recovered from the suspects, police said.

The motive behind the attack remains unknown, although unconfirmed reports indicate that the attackers were attempting to free prisoners held at the station, according to the Standard, a Kenyan newspaper.

This is the second terrorist attack at a police station in Kenya, the last being in July when a rogue officer suspected of having terror links held a station hostage in western Kenya. He was gunned down by Kenya’s elite terror squad.

Since 2011, the al-Shabab group has launched attacks in Kenya, mainly in ­Nairobi and Mombasa.

These attacks are thought to be in retaliation for Kenya’s involvement in a coordinated military mission with the Somalis, under the African Union Mission in Somalia banner, against al-Shabab.

Kenya has also battled homegrown terrorism, with the worst attack having taken place in 2015 at the Garissa University College. It claimed 148 lives.