The end, when it finally came, was just as chaotic, messy and jaw-dropping as every other chapter of Boris Johnson’s political career.

Holed up in Downing Street on Wednesday night, the prime minister faced an open rebellion of his Cabinet, a catastrophic loss of support in his Conservative Party and a wholesale exodus of ministers, which threatened to leave significant parts of the British government without functioning leadership.

Yet far from surrendering, Johnson’s aides put out word that he would continue to fight. It looked like a last roll of the dice by one of the great gamblers in British politics. His brazen refusal to bow to reality invited comparisons to Donald Trump’s defiance in the chaotic days after he lost the 2020 presidential election.