Kevin Pringle, the First Minister’s most trusted aide, has been made the subject of a formal complaint to the Permanent Secretary Sir John Elvidge, Scotland’s top civil servant.

The move will add to the strain on Mr Pringle, who is already said by colleagues to be exhausted after heading a 24/7 media operation for Mr Salmond for the past three years, exposing the 41-year-old spin doctor to unprecedented publicity.

Labour claims Mr Pringle broke the Cabinet Office’s code of conduct for special advisers by stepping into the row over Mark MacLachlan, who worked for Education Secretary Mike Russell.

Mr MacLachlan quit at the end of November after being exposed as the author of the “Universality of Cheese” website, which spread lies and sexual innuendo about rival politicians.

Mr Russell immediately distanced himself from Mr MacLachlan and insisted he knew nothing about his blog. Mr MacLachlan is now pursuing legal action against Mr Russell for alleged unfair dismissal. As part of his case, Mr MacLachlan last week released an email that showed Mr Pringle drafted his resignation letter and suggested how the SNP should handle the affair.

Classed as a “temporary civil servant”, Mr Pringle is not bound by civil service rules on political neutrality and can and does put a pro-SNP spin on government business. However, he is not allowed to stray into purely party matters.

As Mr MacLachlan was employed as a constituency office worker by Mr Russell in his capacity as SNP MSP for South of Scotland, Labour claim Mr Pringle acted outside his jurisdiction.

Section 10 of the code of conduct states: “Briefing on purely party political matters must be handled by the party machine.” But in his email, Mr Pringle issued instructions on the SNP’s response as well as the Government’s, writing: “If asked about his ­membership of the party I suggest from an SNP spokesperson, ‘He has been suspended from the party pending disciplinary action’.” The email was sent from Mr Pringle’s Scottish Government account. Yet Section 6 of the code states: “Special advisers should not use official resources for party political activity.”

Labour’s complaint was lodged on Thursday by Ronnie Nicholson, a Labour councillor from Dumfries who was smeared by Mr MacLachlan’s blog.

He wrote: “For special advisers to draft press statements on behalf of the SNP regarding purely party matters such as membership and internal disciplinary procedures is wrong and a misuse of Government resources. It places the author in breach of the code.

“Mr MacLachlan’s membership, or involvement in disciplinary procedures, of a political party is not a matter for Government and can in no way be construed as such. The public … will not accept the taxpayer should foot the bill for responding to press enquiries about a political party’s internal procedures.”

He added that public trust would “only survive so long as the code of conduct is fairly but rigorously enforced”.

Mr Pringle became the SNP’s communications director in the 1990s. After failing to become MSP in 2003, he left to work for Scottish Gas but came back to his former role in 2006. Since the SNP won power he has been Mr Salmond’s most senior adviser, in charge of “strategic co-ordination across all portfolios”, earning up to £84,000 a year.

A spokesman for Mr Russell said: “Media inquiries on this matter were directed to Mr Russell as a minister, and Mr Russell was supported on that basis. This was clearly not a party political matter – indeed, the only people who keep trying to make it so are Labour.”