Shamsul Bari, an independent expert on human rights in Somalia, briefed members of the United Nations in Geneva on his April visit to the country.
The interim government in Mogadishu is struggling to exert authority outside the capital. Somalia hasn't had a functioning government since the 1990s, though the interim tenure expires in August.
Bari said the institutions for law enforcement in the country have collapsed.
"I am appalled by the terrible prison conditions in Somalia," he said. "Detention conditions are close to inhumane, frequently lacking water and sanitation."
He said that while some of the prisoners in the country are allegedly members of al-Shabaab, an al-Qaida affiliate trying to establish an Islamist state, most of the detentions are arbitrary. Women and girls, he added, were routinely detained for "disobedience."
Bari called on the international community to assess the functionality of the justice system in Somalia.
"Re-establishing a legitimate justice system in Mogadishu and South Central Somalia presents a major challenge, but also an opportunity for the international community," he said.
Wisconsin business offering 'therapeutic cuddling' forced to close
Video of Victoria’s Secret models trying to 'twerk' hits Instagram