To some, he was the real deputy prime minister. To others, he was more important than that. Nick Morrison examines Alastair Campbell's legacy - and looks at what his departure means for Tony Blair

NOT long after Tony Blair had been swept into Downing Street, a national newspaper sent a photographer to get some candid shots of the young Prime Minister and his wife relaxing at home. He had no sooner got Tony and Cherie into position, when the door was flung open and in stormed Alastair Campbell, demanding: "What the hell do you think you're doing?".

The photographer recoiled and braced himself for the verbal onslaught which was sure to follow from the fearsome Campbell, only to find that the admonishment was aimed not at him, but at the Prime Minister.

Like many stories about the Prime Minister's press secretary, it may or may not be true, but that this is even an issue shows the position of Campbell at the heart of the Blair 'project'. Like no prime ministerial spokesman before him, Campbell has been central to the business of Government: not just reporting decisions, but helping make them. And his departure from Number Ten will leave a void at the heart of the Government machine.

One of Tony Blair's first appointments on becoming Labour leader in 1994 was to make Campbell, a former political editor for the Daily Mirror, his press secretary, driving halfway across France personally to plead with him to take the job. And Campbell realised that one of his first and most important tasks was to woo that bete noir of Labour leaders - The Sun.

It was the Murdoch-owned tabloid which boasted after the 1992 election and a relentless campaign against Neil Kinnock: "It was the Sun wot won it". Campbell determined that should not be repeated, and set about courting the Sun, often at the expense of Labour's traditional and loyal ally, and Campbell's former stamping ground, the Mirror.

His strategy of offering exclusive interviews dovetailed with Blair's wrenching Labour into new, more voter-friendly territory, and Peter Mandelson's efforts to transform the party's image, and was an unalloyed success. By the time of the 1997 election, the Sun was not the only traditionally Tory paper to come out for Blair.

With Labour's victory, Campbell became the Prime Minister's chief press secretary, and was responsible for putting together a formidable machine with the objective of controlling the news agenda and putting the Government's views across.

At first, this seemed remarkably successful, as Blair enjoyed the lengthiest honeymoon period of any prime minister in recent times. But, perhaps inevitably, cracks began to show as the task of presentation proved to be a very different one in government than in opposition. The allegation that Labour was all spin and no substance became something of a refrain, and the number of public relations blunders seemed to increase.

There was the handling of the Stephen Byers affair, which was allowed to linger and dog the Government with a fatally-compromised minister for almost a year; Cheriegate, which saw Number Ten spokesmen misleading the public, and finally, and conclusively, the Iraq war.

It was the Government's handling of the dossier detailing the threat posed by Saddam which provided the catalyst for Campbell's departure. Although he denied he had any influence in preparing the dossier, he was accused of producing a "sexed-up" version, exaggerating the threat to strengthen the case for war. His subsequent tirade against the BBC elevated the row into a major point of principle, and the crass behaviour which led to the naming of Dr David Kelly as the source for the allegation demonstrated none of the skills for which Campbell's press machine had become renowned.

Campbell had also made enemies during his time at Number Ten, not least of whom was Chancellor Gordon Brown: Campbell was widely believed to be behind the allegation that Brown had "psychological flaws", although he denied making the remark. As one of Blair's most trusted and influential aides, Campbell was also not averse to giving Cabinet ministers a dressing down if he felt they were in the wrong. The implication was that when Campbell spoke, it was with Blair's voice. It was not for nothing that he was dubbed the real deputy prime minister, much as it irked the nominal holder of that title, John Prescott.

His profile also ensured that he often became the story, instead of the Government line he was trying to promote. His forceful approach and colourful personality - a Burnley-supporting, bagpipe-playing former alcoholic who wrote soft porn for magazines to supplement his student grant - made him a convenient target. Even his decision in 2000 to step aside from the daily Downing Street briefings in favour of a more strategic role did not take him out of the limelight.

But, whatever his failings and however numerous his enemies, Campbell's achievement was to make presentation an integral part of policy-making. While previous Labour administrations had battled a a hostile press, Campbell, along with Peter Mandelson, had seen the importance of winning over those enemies, and to tailor their message accordingly.

"This is part and parcel of the way in which New Labour has come to relate to the media," according to Dr Nick Randall, lecturer in British politics at Newcastle University. "Media considerations have been taken from the outset, and figures involved in presenting it have become involved in drawing up the policy. This is now integral to the mindset of those at the top echelons."

And while Campbell may have lately come to be seen as something of a liability, he leaves a formidable legacy.

"I think he will be remembered in much the same terms as somebody like Bernard Ingham (Mrs Thatcher's press secretary)," says Dr Randall. "In many respects, Ingham was the one on whom Campbell modelled himself.

"He is obviously going to go down as one of the great spin doctors, although whether that is a good or a bad thing depends on your perspective. Within sections of the Labour Party there will be much rubbing of hands: they will be glad to see him go, and I suspect many of the Cabinet will be thanking God he has finally gone.

"This Labour Government's relationship with the press has had its stresses and strains, but it has been far better than most other Labour governments. The degree of unity in Labour has made the job easier, but it has been part of a deliberate strategy, and Campbell had an important role to play in that. That is his legacy and his great achievement."

As he leaves Downing Street after six years, and after nine years as his master's voice, Campbell can look back at an enviable record of success. And while the manner of his departure may be less than satisfactory, at least he has his memoirs as consolation.