Updated

Somalia's prime minister expressed concern Monday over the detention of what he says are law-abiding Somalis in Kenya, where police are conducting a security crackdown aimed at stopping terrorist attacks.

Kenyan police have arrested thousands of people, most of them ethnic Somalis, following a wave of violent attacks blamed on the Somali militant group al-Shabab. Last week a car bomb exploded outside a Nairobi police station, killing two policemen and two occupants of the vehicle, both ethnic Somalis.

The security operation has been strongly criticized by rights groups who say authorities are profiling Somalis, detaining them without trial, extorting refugees, holding the suspects in inhumane conditions and circumventing the law to deport some back to Somalia.

Rights activists have warned the targeting of Somalis could lead to xenophobia and increase radicalization of Muslim youths, who may feel their religion is under attack.

The operation led to the arrest of Somalia's consular officer in Kenya, Siyad Mohamud Shire, violating his diplomatic immunity, Somali Prime Minister Abdiweli Sheikh Ahmed said. Most Somalis in Kenya are peaceful, he said.

"The Federal Government of Somalia continues to expresses serious concerns over the detention of law-abiding Somali citizens in Kenya," he said in a written statement. "The Somali government has been in constant communication with the Kenyan Government on these detentions and would like to see the government of Kenya make every effort to ensure the protection of innocent Somali citizens."

The Islamic extremist rebels of al-Shabab has vowed to carry out attacks on Kenyan soil to avenge the presence of Kenyan troops in Somalia. Kenya sent troops into Somalia in 2011 to fight al-Shabab, which the Kenyan government blamed for a spate of cross-border attacks.

Earlier this year the Kenyan government charged a Somali diplomat with terrorism-related charges for the detonation of an improvised explosive device at a popular restaurant in Kenya's main international airport.

The diplomat, identified as the third secretary at the embassy, is among four Somalis accused of involvement in the Jan. 16 attack. No one was hurt in the incident.

A police official who insisted on anonymity because he is not authorized to speak with the press, said authorities have phone records that appear to indicate the Somali diplomat was communicating with two of the suspected airport bombers while they were on their way to the airport.

The Somali government has not issued any statement on the arrest and prosecution of the embassy employee.