Human Rights Watch has accused Kenya of treating Somalis like scapegoats amid swoops by security forces that have seen thousands arrested and scores expelled back to their war-torn country.
"Scapegoating and abusing Somalis for heinous attacks by unknown people is not going to protect Kenyans, Somalis, or anyone else against more attacks," said HRW's Gerry Simpson on Friday.
"Kenya's deportation of Somalis to their conflict-ridden country without allowing them to seek asylum would be a flagrant breach of its legal obligations."
Kenyan authorities launched the mass round-ups last week, saying they needed to weed out sympathisers of Somalia's al-Qaeda-linked al-Shabab rebels following a string of attacks.
The operation has focused on Nairobi's main Somali district Eastleigh, and residents have accused police of indiscriminately arresting people of Somali origin.
The group said it had visited Pangani police station in Eastleigh and found hundreds of detainees packed into cells designed to accommodate 20 people.
"Detainees had no room to sit, and the cells were filthy with urine and excrement. Police were also holding detainees beyond the 24-hour limit proscribed under Kenyan law, without taking them to court," HRW said.
It said it had seen police "whipping, beating, and verbally abusing detainees", and said Kenyan security forces had also been extorting money.
Joseph Ole Lenku, Kenya's interior minister, has said close to 4,000 people have so far been detained in the operation, and 82 of them flown back to Somalia's capital Mogadishu. He said hundreds more were still undergoing identity checks.
Somalia-based al-Shabab rebel group claimed responsibility for the attack last year on the Westgate shopping mall in Nairobi which left at least 67 dead.
Recent weeks have seen a string of attacks blamed on the group in the capital and near the coastal city of Mombasa.