So this is how it ends for Matt Hancock (for now).

After months of leading the country through the pandemic and being caught in his own political crises along the way, the health secretary was brought down not by his failures but by his personal life.

As soon as the bombshell photos of that embrace were splashed on the front page of The Sun Mr Hancock was fighting a losing battle.

Not because he was caught up in an extramarital affair – but because he was caught out breaking his own social distancing guidance, possibly the law and putting his lover on the public payroll.

Please use Chrome browser for a more accessible video player

‘Those who make these rules have to stick by them’

He had tried to hang on, refusing to fall on his sword after the images of him embracing Gina Coladangelo in his office at the Department of Health were published.

But ever since the scandal broke MPs, ministers and government aides have been whispering that the health secretary couldn’t cling on.

As one cabinet minister told me, his “credibility had collapsed”.

More on Boris Johnson

“He did the right thing and resigned, unlike Dominic Cummings.”

But what helped save Mr Cummings back in May 2020, in fact helped bury Mr Hancock.

While the Number 10 team rallied MPs and ministers to publicly support (or at least not publicly criticise) the prime minister’s chief aide when his job hung in the balance over his trip to Durham and Barnard Castle, Mr Hancock found no such support.

What he found was not just silence, but the growing disquiet amongst colleagues becoming more vocal as the scandal ran.

Whether he wanted to quit or not, in the end Mr Hancock had little option. His position had become untenable.

For the prime minister’s part, one person who knows him well told me Boris Johnson would have been loathed to sack Mr Hancock.

He is “still sore” from being sacked from Michael Howard’s frontbench in 2004 for lying over his own affair with journalist Petronella Wyatt.

And he is known for digging in over scandals around his top team – be it Mr Cummings over Durham, or Priti Patel over bullying accusations.

But while he said he was sorry to receive Mr Hancock’s resignation, he must too be relieved.

This scandal was only going to build, with questions surrounding the appointment of Ms Coladangelo to the health department’s board, and whether Mr Hancock broke the laws he himself wrote not going away.

Imagine Mr Johnson at one of his regular press conferences having to defend Mr Hancock publicly while the public looked on. It’s political capital he’d rather not burn.

But there is criticism too that he did not show leadership and remove Mr Hancock as opposed to waiting for the health secretary to throw in the towel.

Keir Starmer, the Labour leader, tweeted on Saturday night: “Boris should have sacked him.”

It is a view shared by some of his own MPs, who were quietly furious at Mr Hancock’s conduct and the wider fallout and demanded Number 10 did something about it. Mr Johnson this weekend a little tarnished by someone else’s sleaze.

And he also loses the scapegoat for the public inquiry into his handling of the pandemic which begins next year.

MPs openly talk about how Mr Hancock would be kept on as health secretary until then – despite the leaked text messages from the PM describing him as “f***ing useless” – so Mr Johnson would have someone to sack over his government’s handling of the COVID pandemic.

Mr Hancock beat him to it.