The prime minister, searching for the mot juste, calls it a "firestorm". The incendiary metaphor is an apposite one. Fire is both a destroyer and a cleanser, a force capable of giving life and taking it away.

There are months, possibly years, of investigating, inquiring and inquesting ahead of us before we can draw up a full account, but we can start an interim reckoning of the winners and losers from the hacking inferno.

The biggest loser is obviously the House of Murdoch which has been impelled to close the News of the World and abandon its bid to take total control of BSkyB. The blaze that began in the British outpost of the empire is now leaping across the Atlantic to America where senators and congressmen talk of prosecutions under US bribery and bugging laws. Every other attempt to douse the flames having failed, this weekend Rupert Murdoch has even been reduced to buying space in the pages of his competitors to publish a signed apology. In another example of the humbling of this once-mighty beast, on Tuesday he and his son James will be dragged unwilling to answer to a committee of MPs. Let us hope that the parliamentarians have the skill to rise to the occasion.

Another clear casualty is the reputation of the Metropolitan Police, badly scorched by the twin charges that some of its officers had corrupt relationships with the tabloid press and that senior figures at the Met were so incompetent or so compromised that they failed to act.

Among the politicians, the big loser is David Cameron. It is self-revealing that he describes it as a "firestorm". The prime minister feels he has been engulfed by an explosion of all-consuming heat that he did not understand and could not control. The flames were licking around his trousers before he finally woke up to the gravity of the situation. The conservative press has turned on him and its fury about the prospect of stricter regulation will create lasting complications for the Tories' relationship with their papers. "He has displayed an alarming lack of judgment that has allowed the Labour party to seize the political agenda," complains the Daily Telegraph. "The whole media may now find themselves facing new curbs to help cover his political embarrassment." The prime minister has avoided incineration, but his reputation has suffered third-degree burns, at least.

A blaze has also been lit under Ed Miliband. In his case, fire has been a giver of life. He is the stand-out political winner. Just a fortnight or so ago, the consensus of Westminster wisdom was distilled in a headline in a respectable newspaper not unsympathetic to Labour. It read: "Miliband running out of time". The government was making a mess of a lot of things, the health service being a notable example, but David Cameron still had the swagger of the dominant figure on the political landscape while Ed Miliband struggled to make an impact either in the media or among the voters. There was ill-concealed angst in the shadow cabinet that they were adrift. The Labour leader of that long ago era, the day before yesterday, was said to be facing a make-or-break party conference this autumn. Ed Miliband was regarded, if we are brutally honest about it, as the geek who squeaks.

He has now proved that he is a geek with teeth. As I reported last week, the Labour leader was initially hesitant about seizing on the hacking scandal for fear of the revenge of the Murdochs. But when he did act, he did so with much gusto and not a little courage. So much has passed so quickly that it is easy to forget that it is less than a fortnight ago that he made three key demands: for a public inquiry; for a block on the News International takeover of BSkyB; and for the resignation of Rebekah Brooks.

It is also easy to forget that a lot of people, including members of the shadow cabinet and his inner circle, thought it recklessness bordering on insanity for the Labour leader to make such demands. News International, at that stage still imperiously confident that it could swat aside mere politicians, reacted by ignoring Her Majesty's leader of the opposition. The prime minister's first instinct was to reject all three demands while Tories privately chortled that their opponent had made a cardinal strategic error by declaring war on the Sun King. As recently as last Friday, one senior government strategist, trying to explain David Cameron's reluctance to come off the fence over the BSkyB bid, argued with me: "It is rule one of British politics that you don't cross Rupert Murdoch."

Today, Ed Miliband has the satisfaction of having achieved the unconditional surrender of both the prime minister and the most powerful media baron in the world. A judge-led inquiry is being set up with a remit for which the prime minister had to seek the Labour leader's approval. The BSkyB takeover has been killed, a direct consequence of Labour's decision to put the issue before the Commons and careful collaboration with the Lib Dems who are also feeling a bit perkier. Rebekah Brooks then fell – or was thrust – on to the spike. A hat-trick for Mr Miliband. He has humiliated Rupert Murdoch, he has forced David Cameron to dance to his tunes and he has been bolder than his two predecessors as Labour leader, neither of whom had the cojones to take on News International. Gordon Brown's self-pitying attempt to blame his failure to hold an inquiry on the cabinet secretary was not impressive. Only one of Mr Miliband's demands is still outstanding, his call for David Cameron to acknowledge that it was a catastrophic misjudgment to employ Andy Coulson at Number 10. The Labour leader may be happy not to achieve that one, since the prime minister suffers continuing damage so long as he cannot bring himself to admit that it was a mistake to bring the former editor of the News of the World into the heart of government.

These successes will consolidate Ed Miliband's grip, which was previously looking shaky, over his party. Labour activists, who have loathed the incestuous relationship their leaders felt impelled to develop with the Murdoch press, will love him for this. Labour MPs have more bounce than at any time since the election. One member of the shadow cabinet, not usually a personality given to gushing, enthused to me last week: "Ed has been fantastic." The media, which were growing dismissive of him, will pay Mr Miliband more attention. The Tories will no longer be so contemptuous. A little bit of fear has been injected into their bones about what the Labour leader is capable of.

Now, my caution for Mr Miliband. He may expect, but he will not necessarily get, an instantly big benefit from this in terms of polling. For a recent edition of Newsnight, the producers filled the studio with a group of swing voters. Jeremy Paxman struggled to draw from them much evidence that a tumultuous fortnight in the politico-media world had changed their views of any of the party leaders. One woman in the audience opined that the hacking scandal would soon be "chip wrapping". She may be right. By the time of the next election, certainly, I can think of at least 10 subjects that will be much more important to voters. Crime, employment, the environment, Europe, health, inflation, immigration, schools, tax and unemployment will move many more crosses in boxes. You can probably think of 10 more issues that will be much more decisive in influencing the outcome of the next election.

The Labour leader will make a mistake if he concludes that his performance in recent days, impressive though it has been, has answered all the criticisms and doubts about Labour and himself. He and his party are still in need of a persuasive vision and plausible positions, especially on the economy, before they look like a credible alternative government. Some of his more excitable supporters have described this as Mr Miliband's "Diana moment". That is hyperbolic bilge. He still has lots of work to do to turn himself into a rounded, engaging and authoritative personality in the eyes of the public.

What he has gained from this is an opportunity to be heard with enhanced respect on other subjects. That opening, if properly exploited, could secure lasting political dividends. The Labour leader makes a start in his interview with the Observer today. He locates the News International scandal in a broader theme about the need for a new culture of "responsibility" among the powerful, whether they be media barons or bankers.

There is a truth in the cliche about success breeding success, especially in politics. To have bested both Rupert Murdoch and David Cameron will surely be a great boost to the Labour leader's self-confidence. If he can infuse that into his party, Labour could begin to overcome the chronic aversion to risk that has weighed it down.

For most of his first year behind the wheel, Ed Miliband steered his party like a rather nervous novice driver. In the past 10 days, we have seen him throw off the L-plates. He has won for himself the chance to show that he can really motor.