Three Court of Appeal judges yesterday unanimously ruled that Westminster City Council acted unlawfully when it refused to offer accommodation to Gaudenzio Castelli, 36, and Jose Tristan-Garcia, 33, because they were European Union immigrants with no realistic prospect of finding work.
The judges upheld the men's claim that their medical condition had entitled them to housing under European law when they made their applications last year, even though they were jobless.
The decision was seen by many as a setback to the Government's crackdown on "benefits tourists" from EU countries accused of taking advantage of Britain's benefits system.
But the Department of Environment said the gap in legislation which allows such claims to be made would be closed by the new Housing Bill, expected to become law next autumn.
Lord Justice Staughton, sitting with Lord Justice Evans and Lord Justice Swinton Thomas, gave Westminster council permission to challenge the court's ruling in the House of Lords after saying that the case raised issues of public importance.
The council said later it was "disappointed" and was considering whether to appeal.
Ayer Kemal, for Westminster, said: "The significance of this case is that it does give rights of housing to all EU nationals, even if they do not have a right of residence within the country. The decision is of great importance to housing authorities all over the country."
The Immunity Legal Centre, which represented Mr Tristan-Garcia, welcomed the ruling. Their client "entered the country lawfully, required no leave to remain and continues to live here lawfully", they said.
"Westminster City Council were wrong to avoid their duty to house him on the grounds of his immigration status."Reuse content