A federal high court judge in Nigeria’s capital, Abuja, has awarded 16 women 100,000 naira ($275; £210) each after ruling that their 2017 arrest was an infringement of their right to privacy.
It is believed that the women were detained because they were accused of being sex workers.
In court, the women’s lawyer, Bamidele Jacobs, argued that sex work was not specifically a crime in Nigeria.
Mr Jacob also argued that “the act of pulling down the doors of the applicants [and] indecently searching them” was a violation of their “dignity… and right to private life”, a summary of the judgement says.
Justice Binta Nyako said the women’s rights under the constitution had been violated.
In their defence, the authorities argued that the women had been detained after violating a section of Abuja environmental law, the judgement says.
But Justice Nyako said constitutional rights overrode the local regulations.
She did not, however, specifically state that sex work was not a crime.
Mr Jacob told the BBC that he was thinking of appealing against the ruling in order to get the court to make a specific pronouncement that sex work was not against the law.
The BBC’s Chris Ewokor in Abuja says sex workers are often harassed by security agents.
In a crackdown in May this year, more than 60 women accused of being sex workers were arrested in Abuja. Many of the women say they were assaulted and publicly shamed.