Cast your mind back to late-June 2011: Ed Miliband has been leader of the Labour Party for nine months. During this time he has floundered - failing to take advantage of the Lib Dems' tuition fees furore, and ending up on the wrong side of most of the country and half his party by supporting the alternative vote. In the recesses of Westminster people are talking: "maybe we did get the wrong brother; maybe we should ease him out of the chair before he does irreparable damage to the party?"
Then the hacking scandal breaks. David Cameron, who still has Andy Coulson handling the press operation in Downing Street, is caught off-guard. Ed strides onto the floor of the Commons for three consecutive PMQs' and demands answers that the Prime Minister can't give. And, just as it looks like the Labour leader has pushed things too far, the hacking of Milly Dowler's phone emerges, the Leveson Inquiry is established and the News of the World closed. Ed, revitalised, brings his party and the wavering centre-left press behind him and lives to fight another day.
Late-November 2012: David Cameron is under pressure. The only post-Olympic bounce has been in the Q3 GDP figures, which have failed to lift the bad economic feeling generated by the omnishambolic budget in the spring. He's had a reshuffle he could have done without, prompted by a series of ministerial gaffes he didn't need. A decent Conservative Party performance in the Police and Crime Commissioner elections can't mask the appalling public response to a key plank of Tory policy, and the 'rise of Ukip' discourse is starting to get overbearing.
Then Leveson reports. Backed into an unlikely corner with several of his party MPs rebelling to side with the anti-Murdoch, pro-state regulation brigade, the Prime Minister needs to come out fighting. The polls, although unreliable, suggest the public are against self-regulation and don't want to see politicians and the media cozying up once again. Cameron, who has said he is opposed to state regulation on several occasions in the past, has to walk a fine line in sorting out the system without trampling on over 300 years of press freedom. He succeeds.
Yes, the likes of Tom Watson, Chris Bryant and Hacked Off are, well, hacked off with the Prime Minister's statement on Thursday. But inside his own party the members are impressed. His unfair reputation for u-turns and caving at the crucial moment has been extinguished. Equally important, the media - almost as one - support Cameron's position over that of Ed Miliband's. The narrative has been written: the Prime Minister is decisive and sticks to what he believes; the leader of the opposition has been nobbled by a special interest clique of demi-celebs and media critics.
On Thursday David Cameron achieved what Blair did with Iraq and Thatcher with the miner's strike: take the difficult, unpopular, but Prime Ministerial route. And if justice is done, he too will be rewarded.