Asylum seekers can continue to be housed at the Bell Hotel in Essex, a court has ruled.
Epping Forest District Council (EFDC) had wanted to secure a High Court injunction that would block them from living there.
It took legal action against Somani Hotels, the hotel owner, claiming that accommodating asylum seekers there breaches planning rules.
Lawyers for EFDC said the housing of asylum seekers is a "material change of use" and has caused "increasingly regular protests".
The Home Office intervened in the case, telling the court the council's bid was "misconceived".
Now Justice Mould has dismissed the claim, saying: "I have not been persuaded that an injunction is a commensurate response to that postulated breach of planning control."
He added that there was a "continuing need" for hotels to supply "contingency accommodation" to asylum seekers, and that this statutory responsibility was a "significant counterbalancing factor".
He said the council had also not provided evidence of its argument that the asylum seekers had a propensity towards crime or anti-social behaviour.
He argued that he needed to see an "evidence-based" and "statistically sound analysis" proving this phenomenon, but insisted "there is no such evidence before the court".
He said: "The fact that persons accommodated in asylum accommodation... from time to time commit criminal offences or behave antisocially provides no reliable basis for asserting any particular propensity of asylum seekers to engage in criminal or anti-social behaviour.
"Persons who are members of the settled population also commit crimes and behave antisocially from time to time."
The decision is already sparking political blowback.
Shadow home secretary Chris Philp of the Conservative Party said: "This is a dark day for local democracy and a slap in the face to the people of Epping.
"A Labour government has once again put the rights of illegal immigrants above the rights of British citizens.
"The people of Epping have been silenced in their own town. Their council fought for them, their voices were ignored."
Referring to the Home Office's intervention in the case, he added: "Labour's lawyers fought tooth and nail to keep this hotel open".
Amid protests outside the hotel, the council were granted a temporary injunction earlier this year, which would have stopped 138 asylum seekers being housed there beyond September 12.
But this also fell flat when the Court of Appeal found the decision to be "seriously flawed in principle".
This breaking news story is being updated and more details will be published shortly.
Please refresh the page for the latest version.
You can receive breaking news alerts on a smartphone or tablet via the Sky News app. You can also follow us on WhatsApp and subscribe to our YouTube channel to keep up with the latest news.