Damian McBride was supposed to disappear last autumn. Officially, he stood down as Gordon Brown's political spin doctor, his job split between two former aides to the Cabinet ministers Geoff Hoon and John Hutton.

When Mr Brown reshuffled his Cabinet in October, the small print announced that Mr McBride would be moved to the relative backwater of "strategic planning". Cabinet ministers had demanded the removal of the man they referred to as "McPoison", suspecting that his dark arts and vitriolic briefings had been aimed against some of them – as well as the Tories.

The final straw was his notorious 3am briefing in a Manchester hotel bar about the impending resignation from the Cabinet of Ruth Kelly, then the Transport Secretary. From Mr McBride's point of view, he was defending his master – on this occasion from the explosive suggestion that Ms Kelly's move was the first in a series of resignations designed to oust Mr Brown in a Cabinet coup.

Download the new Independent Premium app Sharing the full story, not just the headlines

The Cabinet ministers called off the threat of insurrection and rallied behind Mr Brown under a deal which included the sidelining of McBride and the surprise return of Peter Mandelson, the public symbol of a fresh start, and of Labour's warring tribes coming together to fight the Tories.

Yet the Prime Minister seemed reluctant to part company with a close ally who first won his admiration with deft handling of the fuel protests in 2000. The pair bonded when Mr McBride was his civil service press secretary at the Treasury before becoming his special adviser and party political spokesman for the then-Chancellor.

He carried on spinning for Mr Brown when his boss moved to Downing Street, cementing contacts among a spectrum of reporters. He was part of Mr Brown's pack of attack dogs, which includes the Government whip Ian Austin and the chief whip Nick Brown.

After he was moved out of the limelight in October, the naturally gregarious spin doctor kept a low profile among Westminster journalists, declining invitations for lunch and maintaining only occasional contact with most.

But, crucially, he kept his place in the Brown inner circle, symbolised by his place at the top table in Mr Brown's new "war room" in 12 Downing Street.

Mr Brown, it seems, did not want to sever links with his trusted aide. "He decided he couldn't do without him, and didn't find someone to replace him," one insider said yesterday.

Inside the Brown circle, there were grave doubts about his continuing presence. Two Cabinet ministers in the circle, Ed Miliband and Douglas Alexander, did not want him to enjoy as much influence as he continued to wield despite his demotion in 0ctober. The pair regarded Mr McBride with "a mixture of fear and loathing" and civil servants were also uneasy about his new Cabinet Office role.

Inside Politics newsletter The latest news on Brexit, politics and beyond direct to your inbox Enter your email address Continue Continue Please enter an email address Email address is invalid Fill out this field Email address is invalid Email already exists. Log in to update your newsletter preferences Register with your social account or click here to log in I would like to receive updates on politics every morning by email Update newsletter preferences

But Mr McBride had a trump card: his close axis with Ed Balls, the Schools Secretary, which dates back to their time together at the Treasury. Mr Balls and Lord Mandelson are seen as the two Cabinet ministers closest to the Prime Minister. Yesterday some ministers suggested that Mr McBride saw his job as serving Mr Balls, a likely candidate for the Labour leadership when Mr Brown steps down.

"Damian was pretty friendless in No 10," one Brown aide said yesterday. "But he had a powerful champion in Ed Balls. That made it virtually impossible for anyone to move against him – including Gordon. It's astonishing."

Mr McBride's retreat into the shadows in October coincided with growing concern among senior ministers about the dominance of the blogosphere by Tory-leaning commentators. Bloggers such as Paul Staines – aka Guido Fawkes – and the former Conservative candidate Iain Dale have regularly dug under the skin of Labour HQ with their spiky mixture of gossip, commentary and news. Derek Draper, a former aide to Peter Mandelson who was forced to resign after being caught on tape in 1998 boasting he was "intimate" with the 17 people who really mattered in the Government, returned to the political front line to help beef up the Labour presence on the blogosphere.

Many Labour figures view "Dolly Draper" (as he is known) with caution. One backbencher said yesterday: "You can't fault his enthusiasm or energy. But there is plenty else about him that's a bit wild." But he rapidly began reactivating the old friendships – and forging for new ones – as he plotted a "virtual revolution". Among those that he contacted for help was Damian McBride.

Mr Draper unveiled his Labour List website to middling reviews in the autumn, although it has not captured the irreverent tone of its right-of-centre rivals. Yesterday, senior party figures tumbled over one another to distance themselves from the site and its co-editor – but it was very different at the official launch just two months ago. That event took place in Labour HQ and guests included Lord Mandelson, Douglas Alexander, the Cabinet Office minister Tom Watson and the Labour general-secretary Ray Collins.

It is clear now that Mr Draper was toying with the idea of founding a more scurrilous sideline which he proposed calling RedRag. And who better to discuss the idea with than Labour's most powerful spinner?

He may have been out of sight – during Barack Obama's recent visit he was given the relatively peripheral duty of handling the "Wags briefing" of the media on behalf of Sarah Brown – but Mr McBride's passion for spreading "the message" remained undimmed.

Mr McBride suggested reviving the allegation that a Tory MP was quietly promoting a gay partner's business interests in the Commons. The claims have been in circulation for months and proved to be false. Pumping such a story – had it been true – could have been justified as in the public interest. But the other bits of gossip Mr McBride proposed pumping into the political ether were a combination of venom and invention designed to unsettle a Tory opposition riding high in the polls. Mr McBride's critics, who believe he was more interested in short-term tactics than long-term strategy, may feel vindicated by the dramatic events of the last 48 hours. "This was a huge collision waiting to happen," one Brown adviser admitted.

Ironically for Mr McBride, the episode has dealt a damaging blow to the Prime Minister whose merits he had tirelessly promoted seven days a week – and even while on holiday.

Mr Brown promised to put an era of spin behind him when he succeeded Tony Blair to Downing Street. It seemed a fanciful claim for the politician who once gave Charlie Whelan an almost free hand to speak for him, but struck a chord among Labour activists sick of a decade of tales of Downing Street media manipulation.

As a senior Labour MP said yesterday: "This is terrible. It stinks. It reflects very badly on Gordon and damages him. He didn't stick to his side of the bargain about Damian. Now he has paid the price."

Labour's attack dogs...

* Damian McBride

Gordon Brown's special adviser resigned after his position became untenable. Some already predict he will help Labour fight the next election.

*Charlie Whelan

Copied into McBride's email. Bullish former Brown spin doctor, now political director of the union Unite. On answerphone yesterday.

*Tom Watson

Cabinet Office minister and Brown cheerleader: "The email content was completely inappropriate."

*Nick Brown

Close ally of the Prime Minister, now Chief Whip. On answerphone yesterday and uncontactable.

*Ian Austin

Whip and Brown henchman. He insisted yesterday: "I knew about nothing. I had no knowledge of it all."

*Derek Draper

The former Mandelson aide and founder of LabourList website said: "I am particularly sorry to the individuals mentioned."

The groundless slurs...

*George Osborne

Proposes falsely claiming that embarrassing pictures of Mr Osborne exist from his undergraduate days. He suggests the website should hint that pictures exist of the future shadow Chancellor "posing in a bra, knickers and suspenders" and "with his face 'blacked up' ". McBride writes: "He wouldn't be the first student to do some cross-dressing at university. But ... why would a student in the late 1980s black up his face for the amusement of friends in their private college rooms? This in the era when young Tories wore 'Hang Mandela' T-shirts." McBride says: "Embarrassing photos have followed George Osborne around ... But he knows that the most embarrassing photos have yet to emerge."

*Frances Osborne

McBride suggests the Labour website carry a story concerning an unwarranted personal slur on George Osborne's wife Frances.

*David Cameron

Proposes spreading gossip that the Tory leader may have suffered from a sexually transmitted disease and suggests "inserting [a] picture of Dr Christian Jessen", who appears on the Channel 4 programme Embarrassing Bodies, on the website. Also says it should call on Cameron to follow the lead of US presidential candidates and publish his "full financial and medical records".

*Nadine Dorries

Floats the idea of falsely hinting that Ms Dorries, the Conservative MP for Mid-Bedfordshire, had a one-night stand with a married parliamentary colleague during a party away-day excursion. He suggests that the website hints that a sex aid was accidentally left lying around in a hotel bedroom. He claims: "I'm told by a witness that both MPs received a carpeting."