Allies of Local Government Secretary Steve Reed – who is ultimately responsible for this reversal – argue that their approach shifted because the legal advice changed. But they won’t explain how.

“We’re trying to make policy while live legal advice is fed in,” says one official. “It’s never going to be perfect.”

It seems highly likely that ministers were warned that they might lose Reform’s court challenge.

Even though the case is now not going ahead, the government still faces a significant lawyers’ bill, as well as having to pick up Reform’s legal costs which are reported to be more than £100,000.

Ministers have also committed to helping those councils that will now need to run complex multi-ward elections with just two and half months’ notice.

The District Councils Network, which represents many of the smaller councils affected, says voters will be “bewildered”.

The fallout from this embarrassment is far from over. The Conservatives and Liberal Democrats are calling for the government’s legal advice to be published – something that is likely to be fiercely resisted in Whitehall.

The Lib Dems are also considering using their upcoming ‘opposition day’ in Parliament next week to try and force the government to reveal what happened.