Harry FarleyPolitical correspondent
The Court of Appeal ruling that will allow asylum seekers to stay at the Bell Hotel, in Epping, is a technical victory for the government.
But for many Labour strategists, whichever way the ruling had gone, today was a case of "heads they win, tails we lose".
Let's begin with the good news for ministers.
They will be breathing a sigh of relief having feared that, had they lost this appeal, other local councils could bring legal challenges against the use of hotels to house asylum seekers in their area.
That would have risked throwing the whole system into chaos because there are thousands of asylum seekers awaiting decisions on their cases and limited accommodation options.
But the government has a legal duty to keep them off the streets.
This court ruling effectively resets the situation.
It gives ministers the time to fulfil their promise of removing all asylum seekers from hotels in "a controlled and orderly way" by 2029.
But there will not be any champagne corks popping in the Home Office.
That's because in order to uphold their legal responsibility to protect asylum seekers, they have had to argue in favour of using hotels to house them.
That is already being seized on by Labour's political opponents.
Reform UK leader Nigel Farage claimed the government had used European human rights legislation "against the people of Epping" and that migrants had "more rights than the British people under Starmer".
The government had tried to make the case that it needed to comply with the European Convention on Human Rights but the duty to house asylum seekers so they don't sleep rough is a piece of British law, passed by MPs in 1999.
Conservative leader Kemi Badenoch said: "Keir Starmer has shown that he puts the rights of illegal immigrants above the rights of the British people who just want to feel safe in their towns and communities."
She urged Tory councils to continue to bring legal cases against asylum hotels.
For a government under pressure after a summer of small boat crossings, this is a difficult position to be in.
As one Labour adviser told me, there will now be pressure on ministers to take more radical action to counter the kind of accusations they are facing.
That could include swapping some hotels for former military barracks or disused warehouses, as the health minister Stephen Kinnock suggested earlier on Sky News.
But such a move could further antagonise those voters on the left who believe the UK should be offering more support to asylum seekers.
The Green Party said the case was "a distraction" from "Labour's failure to come up with workable, humane solutions".
Former Labour leader and independent MP Jeremy Corbyn said asylum seekers "should be supported so they can live in a more humane, sustainable, community-based form of accommodation".
He added: "Both Reform and Labour want you to think that the problems in our society are caused by these minorities. They're not."
This court ruling might have been the climax to a difficult summer for the government. But it also marks the start of an autumn that doesn't look much easier.