Starmer will be judged on how he tackles root causes of riots

London: “This could have been so much worse,” a Downing Street adviser tells me. “People were trying to set fire to a hotel with people inside.”

But the prime minister, they insist, is “focussed” – and after a career spent largely in the criminal justice system “knows which levers to pull”.

Sir Keir Starmer was the chief prosecutor of England and Wales during the last major outbreak of civil unrest in the UK in 2011, overseeing the prosecution of thousands of people involved in five days of rioting.

Rapid and well-publicised action by the courts was key in bringing the unrest to an end, he said then. And this time ministers have emphasised “strong policing and swift prosecutions” to deter others joining the violence.

How best to get that message across to the public has been a regular discussion at emergency COBR (Cabinet Office Briefing Room) meetings.

Just as government scientists were front and centre in the pandemic, police chiefs and prosecutors have been wheeled out to land core messages with authority in this crisis.

Stephen Parkinson, the otherwise low-profile Director of Public Prosecutions, was put before the cameras. Metropolitan Police Commissioner Sir Mark Rowley made regular appearances.

Yet the prime minister and his aides have pointedly avoided answering questions about the underlying causes of the riots.

I’m told the reason for this message discipline is a concern that discussing causes might be misinterpreted as suggesting some of the unrest was justified.

What happens, though, when the violence stops, the guilty rioters have been sentenced and the COBR meetings are over?

“We are starting work on the longer term challenges,” sources say.

Tackling these challenges – even deciding what they are – is set to be a crucial test for the new government, with consequences stretching far beyond the communities affected by this week’s disorder.

As police cars were burning in the UK, the Chancellor Rachel Reeves was in the US trying to burnish the government’s reputation and encourage investment.

On Monday, she insisted the TV images of far-right mobs clashing with police would not damage the UK’s international reputation as a “safe haven for investment”, dismissing the protests as “thuggery”.

But the optics could hardly have been worse for a politician trying to project stability and order under a newly-elected government with a huge majority.

It is likely the towns and cities affected in the riots will receive government money to smooth their recoveries. Local community cohesion projects have also been mooted.

But money is tight. The challenging economic outlook and the chancellor’s reputation for fiscal discipline may be reasons why government sources tell me an expensive public inquiry is unlikely.

After the 1981 Brixton riots, Lord Scarman led one. But David Cameron and Nick Clegg resisted doing likewise after the unrest in 2011. They instead commissioned a cross-party panel to learn lessons.

The role of social media will be the subject of a Whitehall review, with ministers conceding that only nine months after the Online Safety Act became law, it already needs updating and strengthening.