SIR Nicholas Macpherson, the top Treasury civil servant who was accused of not acting impartially by Alex Salmond during the referendum on Scottish independence, has announced his resignation.

In what was reportedly a surprise announcement to Chancellor George Osborne, Macpherson said he felt the time was right to stand aside.

“It has been a privilege to lead the Treasury through an extraordinary period. But after 31 years in the department, and having worked on 33 budgets and 20 spending reviews, it is time to do something else while I still can,” he said.

“With the fiscal strategy for this parliament set and the economic recovery well-established, now is the right time to stand aside and for someone else to guide the Treasury through the challenges ahead.”

During the referendum campaign, a letter to the chancellor said a currency union with an independent Scotland would be “fraught with difficulty”. The publication of the letter was criticised by an influential group of MPs who said it, “compromised the perceived impartiality of one of the UK’s most senior civil servants”.

Salmond said Macpherson should have done the “honourable thing” and resigned over the letter.

Osborne praised Sir Nicholas for his work during some difficult economic times, and added: “Nick’s intelligence, candour and discretion as permanent secretary have been invaluable to me and all who have worked with him.”