A former top civil servant who Alex Salmond once accused of a hostile partisan attack on Scottish independence has said Brexit presents "an extraordinary opportunity" for an independent Scotland to attract skills and investment.

Sir Nicholas Macpherson, permanent secretary to the Treasury during the independence referendum campaign, said Nicola Sturgeon has bolstered the Scottish Government's "fiscal credibility" since she took charge in 2014.

In an article for the Financial Times entitled "the case for Scottish independence looks stronger post-Brexit", Sir Nicholas said the UK's decision to leave the EU "changes terms of debate north of the border".

Reacting to the article on Twitter, Ms Sturgeon said: "This from Nicholas Macpherson, the chief architect of the Treasury's anti Indy stance in 2014, is quite something."

Sir Nicholas, now visiting professor at King's College London, said Brexit presents "a golden opportunity for proponents of Scottish independence to reappraise their economic prospectus".

He added: "An independent Scotland committed to the EU would have an extraordinary opportunity to attract inward investment as well as highly skilled migrants.

"If it can develop a clear and coherent economic strategy ahead of any future referendum, it not only stands a better chance of winning, it will also increase the probability that an independent Scotland inside the EU can hit the ground running."

Sir Nicholas said EU membership will "enable Scotland to have access to the biggest market in the world without the uncertainties that are likely to face the rest of the UK for many years to come".

Edinburgh faces "a historic opportunity" to develop as a financial centre by pulling in staff and resources from London, he said.

However, he said it is "highly uncertain" how quickly Scotland could join the EU, particularly with the objections of Spain, but he added that the EU "has a huge interest in fast-tracking membership for a country whose citizens have been members of the bloc for 43 years and have voted to remain by 62% to 38%".

Sir Nicholas urged the Scottish Government to abandon its plan for a currency union with the remainder of the UK and commit to creating a Scottish pound supported by its own central bank.

He acknowledged that Scotland would have to commit to joining the euro, but said "that does not mean Scotland would have to adopt the euro - at least not straight away", citing Sweden's "vanishingly remote" chances of joining the euro despite its 20-year long obligation to do so.

A Scottish currency would allow Scotland to manage its volatile oil price cycle, he said.

"The Treasury was concerned in 2014 that the Scottish Government's prospectus relied on over-optimistic oil price projections," he said.

"But First Minister Nicola Sturgeon's administration has since worked to bolster its fiscal credibility."

Mr Salmond has said Sir Nicholas "radiated hostility" towards him, and he accused the Treasury mandarin of abandoning "any vestige of civil service impartiality" by warning of the risks of independence during the referendum campaign in 2014.

In his memoirs, Mr Salmond suggested "a background reason for his intense level of politicisation may well lie in his family's extensive land interests in Scotland".