The cabinet secretary, Sir Gus O'Donnell, expressed disapproval that Gordon Brown planned to retain his political aide Damian McBride as one of his special advisers when he became prime minister, according to former aides of Tony Blair.
O'Donnell, the sources said, had doubts about McBride's suitability that dated back to 2005 when McBride worked as a civil servant in the Treasury.
O'Donnell, who was then permanent secretary to the Treasury, asked for McBride's status to be changed to special adviser because of his involvement in political briefing, a practice that could undermine his neutrality.
McBride was moved to a political job at the Treasury, but O'Donnell expressed concerns again two years later, according to sources, at the time of Brown's transition from chancellor to prime minister.
The sources said Blair told his aides that there was a problem with O'Donnell over the appointment of McBride. One source said it was "an open secret".
The cabinet office last night said that O'Donnell had no role in the appointment of special advisers. They are, under the ministerial code, a purely ministerial appointment.
The claims suggest Brown would have been aware of the risks - as perceived by O'Donnell, the head of the civil service - of employing McBride in No 10.
On Saturday McBride quit Downing Street after the leak of emails detailing plans to smear top Conservatives, including David Cameron. McBride said the emails were juvenile and had not been seriously intended for publication.
McBride's move to the position of a special adviser in the Treasury was prompted after it was disclosed that he had been briefing newspapers that John Major was trying to prevent the publication of reports relating to Britain's withdrawal from the exchange rate mechanism in 2002.
In separate developments yesterday, O'Donnell wrote to the Conservatives saying the actions of Brown's former aide fell "far short" of the public's expectations.
He wrote to the shadow minister for the Cabinet Office, Francis Maude, saying McBride's behaviour constituted "a clear and serious breach of the code of conduct for special advisers".
Maude replied to O'Donnell saying he regarded his actions as inadequate and suggested the civil service examine McBride's email account to see if there had been other frequent breaches of the code, or further misuse of taxpayers' money.
The cabinet secretary confirmed that McBride had not received severance pay.
One of Brown's closest political allies, Ed Balls, yesterday suggested all political parties needed to look at themselves in light of the McBride affair.
There were also calls for Unite to withdraw its funding of the LabourList website unless Derek Draper quit as editor.
Draper received the offending emails from McBride, and enthusiastically welcomed his ideas in an email reply.
The Labour party's general secretary, Ray Collins, yesterday wrote to members of the national executive to insist Draper had stopped his voluntary work for the party last month, and would not be employed again.
He had not been paid by the party, and the party had not subsidised LabourList.
Speaking to the BBC, Balls said the emails sent by McBride were "vile, horrible [and] despicable" and that there was no place for activity of that kind in modern politics.
Balls and McBride have both been members of Brown's inner circle, and Balls admitted he had worked closely with McBride when they were both at the Treasury.
Asked whether he had thought McBride was avoiding personal attacks in his contacts with the press, Balls replied: "I did, as far I saw."
Balls said he and his wife, the chief secretary to the Treasury, Yvette Cooper, had also been the subject of unpleasant personal attacks in the blogosphere and claimed the problem of mudslinging of this kind was for all parties to address.
"All of us in politics, in the Labour party, in all political parties, need to look in ourselves, at the people we employ, at the activities they are undertaking, at the things they are doing - we all need to work to raise standards and to stamp this out," he said.