Local residents in the Liberties area of Dublin have won their legal challenge for the use of a former parish hall as a hostel for the homeless.
The residents had challenged Dublin City Council's decision to open Carman's Hall on Francis Street as emergency temporary accommodation for rough sleepers.
The hostel has 51 beds and is run by the Simon Community and the Salvation Army.
It opened just before Christmas last year, after the High Court lifted a stay previously obtained by the residents.
The Council leases it from the Catholic Archdiocese of Dublin.
The High Court found the Council had breached its own development plan and had not given any consideration at all to the question of whether or not the change of use of the building would lead to an undue concentration of such facilities in the area.
Mr Justice Donald Binchy said the council's focus, perhaps understandably, was the provision of emergency accommodation.
But he found it was not correct to say the local authority did not have to consider the development plan in the context of a decision made as an emergency provision in response to a crisis.
He also pointed out the council had been very careful to avoid giving a time limit for the hostel, and it was clear the council intended to use the building as emergency accommodation indefinitely.
The court's ruling does not mean the immediate closure of the hostel, however.
Mr Justice Binchy said he was very mindful of the potential consequences of his decision for the vulnerable people benefitting from the accommodation.
He has adjourned the matter until 8 November, when submissions may be made on the orders he should make.
The judge said he was mindful of the fact that the Council had said they would consult the residents before extending the use of the premises as a hostel beyond this winter.
Mr Justice Binchy said the proceedings concerned one of the most significant social issues in society today.
He said it was perplexing that in an era of unprecedented prosperity - notwithstanding the recent recession - homelessness should continue to present as a problem.
He said there was and is a crisis in the Dublin City area in the provision of accommodation to people who are homeless.
The Chief Executive of the Peter McVerry Trust has said today's high court ruling is understandable, but disappointing.
Speaking on RTÉ's Drivetime, Pat Doyle said he is glad the judge has put a stay on the order, saying to close 51 beds coming into the winter would be a "disaster" for many individuals.
He said every facility across the sector is needed and it is his belief that Carman's Hall was being managed really well.
"We're coming into the Winter. It's very hard to find places quickly. You can't just magic up a replacement," he said.
He added: "I hope the community and the council can work together - at least allow for the project to stay open throughout the Winter of '17 and see what happens in the Spring next year."