Mr McBride left his post despite apologising for the "juvenile and inappropriate" comments and insisting that no one else at Number 10 had been involved.

The former Prime Minister was dragged into the scandal as Mr McBride was one of his closest lieutenants. Mr Brown later wrote to those named in the emails - including Mr Cameron and the Osbornes - "expressing regret".

Mr McBride had been a special adviser to Mr Brown for around four years when the episode broke and prior to that a civil servant at HM Revenue and Customs and the Treasury.

Following the furore, Sir Gus O'Donnell, then head of the civil service, confirmed that Mr McBride had broken the code of conduct for special advisers.

He also revealed that he had tightened up the code, and asked the heads of Whitehall departments to ensure that all Government special advisers signed up to the new rules.

Since leaving Number 10, Mr McBride has been a regular blogger about political life.