MOMBASA, Kenya — Police opened fire on Muslim youths wielding daggers at a mosque linked to recruiting Islamic extremists, and at least one officer and a youth were killed, witnesses and officials said in the coastal resort and port city of Mombasa.

Police said they raided the mosque acting on intelligence that a meeting to recruit militants was going on.

A reporter at the scene saw police shoot and kill one person as they tried to disperse a growing crowd outside the Masjid Musa mosque, which has been the recent site of violent confrontations between young Muslim radicals and police.

A police officer who was stabbed in the face later died of his wounds, said Mombasa police commander Robert Kitur. Another police officer was stabbed in the stomach and is being treated at a local hospital, he said.

Police later occupied the mosque and its precincts, Kitur said.

“We have arrested dozens of youths who attacked our officers while on duty at the mosque and they are under interrogation,” he said. “We have recovered a rifle that was robbed from one of our officers in the exercise. The officers were on a mission to remove radical paraphernalia from the mosque when they faced resistance.”

Kenyan police have linked the Masjid Musa mosque to recruitment of militants for Somalia’s al-Shabab terrorist organization, which claimed responsibility for an attack last year on an upscale shopping mall in which up to 67 people were killed in Nairobi, the capital. The al-Qaida-linked al-Shabab group said that attack was in retaliation for Kenya’s military involvement in Somalia, where the country’s troops are deployed as part of African Union troops fighting the militants.

Henry Ondieki, the Mombasa chief of criminal investigations, said police forcibly entered the mosque after getting intelligence that a meeting to recruit militants was underway. “This was not a normal day of prayers,” he said. “Their intention was clear: they were planning to recruit and attack innocent Kenyan civilians.”

Rights campaigners say the Kenyan government’s harsh counterterrorism measures are pushing Muslim youths toward extremism.

Last October, following the mall attack, gunmen killed a Muslim cleric and three others in a hail of bullets in Mombasa, sparking street violence by youths who accused the police of targeted killings of Muslim leaders.

A Human Rights Watch researcher reported last year that many Somalis who have fled to Kenya because of al-Shabab violence inside Somalia have sometimes faced “serious abuses at the hands of the Kenyan security forces who wrongfully accuse them of supporting” al-Shabab.