The raids, which were conducted at 11 inner city buildings in Johannesburg's central business district between June 2017 and May 2018, were carried out in a manner that was "cruel, humiliating, degrading and invasive", the Gauteng High Court in Johannesburg ruled this week.
In a judgment penned by Judge President Dunstan Mlambo, which was delivered on Monday, the court said the raids were directed at harassing and intimidating the residents into vacating the so-called "hijacked buildings".
Between 30 June 2017 and 3 May 2018, the residents of these buildings were subjected to warrantless searches by police officers.
The police officers, who were accompanied by metro cops, home affairs and City of Johannesburg officials, would then break down locked doors and tear down internal partitions in the applicants' homes.
"Because of this judgment, poor residents of the inner city can enjoy their homes without the fear of being raided by the police."