The Treasury's top civil servant has insisted that publishing his advice to UK Government ministers on a possible currency union with an independent Scotland was "vital to the national interest".

Sir Nicholas Macpherson, the permanent secretary to the Treasury, said he is "confident" he did the right thing in taking the unusual step of making public his advice to Chancellor George Osborne.

The Tory Chancellor ruled out entering into a currency union with Scotland if it leaves the rest of the UK after Sir Nicholas told him such an arrangement could be "fraught with difficulty" and raised concerns about the Scottish Government's commitment to making such a deal work.

First Minister Alex Salmond continues to insist that a currency union is in the best interests of both Scotland and the rest of the UK if there is a Yes vote in September's independence referendum.

But Sir Nicholas told Mr Osborne: ''I would advise strongly against a currency union as currently advocated, if Scotland were to vote for independence.''

He explained to MPs on the Public Administration Select Committee that he had made his advice public because the UK Government wanted to make its position on the crucial issue "absolutely unambiguous, absolutely clear".

While Mr Salmond has accused Sir Nicholas of being beholden to his "political masters", the Treasury permanent secretary said: "This was in the context where the Scottish Government was claiming something was not only in Britain's interests, but that somehow the British Government was blustering and bluffing.

"So this was quite an exceptional set of circumstances which goes to the heart of the integrity of our currency."

He added that making his advice public was "not something I entered into lightly", but stressed: "I happen to believe it was vital to the national interest. I'm confident I made the right decision."

Publishing the advice was about making the "British Government position absolutely crystal clear" in what was a "very unique context where you have another government in the United Kingdom asserting what the United Kingdom would do".

Sir Nicholas said: "I do think these are quite exceptional circumstances which go right to the heart of the national interest. I remain unapologetic.

"I do not propose to make a habit of publishing advice. This was about convincing the British people, the wider world, the markets, of the sincerity of the Government's position."

He said the financial problems in the eurozone had led to the Treasury being "cautious" about currency unions.

Sir Nicholas told MPs: "Why is the Treasury cautious about a currency union? And why does this note advise against the currency union currently proposed by the Scottish Government? Primarily because of the travails of the eurozone - the eurozone crisis has been monumental."

But he said he did not regard his advice as being aimed directly at voters in the independence referendum.

"It's not for me to provide direct advice to voters," the senior civil servant said.

"I think it was about being very clear on the UK's position in relation to pound sterling.

"One of the reasons I published my advice is that the Scottish Government and its Fiscal Commission, which was served by Scottish civil servants, were asserting things about the British Government's and the Treasury's intentions."

He also insisted: "I don't think I have any choice other than to pursue the interests of the UK Government. I'm not a civil servant of the Scottish Government, I'm a civil servant working for the UK Government."

Sir Nicholas insisted it had been his decision to publish the advice to the Chancellor.

"Throughout the debate on economic issues the Scottish Government has sought to cast doubt on the British Government's position," he said.

"It has claimed we're blustering, bluffing - in effect casting aspersions on the UK Government's integrity.

"My view in this case - and it's a very exceptional case - is that if publishing advice could strengthen the credibility of the Government's position, then it was my duty to do it.

"It was important in this specific case, which goes to the heart of the currency issues, that the arguments were exposed before a referendum than after it."

He said it was not unprecedented to publish such advice, but he went on to tell MPs: "I would attach a high bar and it was my decision to publish my advice."

Ministers had asked for the work to be done on currency, he told the committee.

The Chancellor first saw the advice up to a couple of days before it was announced.

"Ultimately this was my call - the Chancellor is a traditionalist in his approach to the Civil Service," he said.

"I am quite certain that if I had said that I did not want to publish this advice he would not have pressed me. I thought it was the right thing to do in exceptional circumstances."

He was asked if he would want to publish advice in the public interest, but against the wishes of a minister.

"I think you then get into quite difficult territory," he replied.

But SNP MSP Kenneth Gibson, the convener of Holyrood's Finance Committee, said that on the issue of a currency union "Westminster's currency bluff has completely crumbled".

Mr Gibson said: "Regardless of the Treasury's actions, we know the real position of the UK Government, as an unnamed Government minister admitted last week, is that 'there will be a currency union... everything would change in the negotiations if there were a Yes vote'.

"As leading economist Professor Anton Muscatelli pointed out earlier this week, rejection of a currency union would be an act of economic vandalism for the rest of the UK. International expert Professor Leslie Young, of Cheung Kong School of Business in Beijing, also described the UK Government's opposition to a currency union as 'entirely a false argument' based on 'weasel words'.

"Even Alistair Darling himself has said that a shared sterling area is 'desirable' and 'logical'. It's time for the No campaign to stop the foolish bluffing, put its money where its mouth is and back sharing the pound."

A spokesman for Better Together, the cross-party campaign headed by Mr Darling aimed at keeping Scotland in the UK, said: "A currency union would not happen. It wouldn't be in the interests of a separate Scotland and it wouldn't be in the interests of the continuing UK.

"The Prime Minister, the Chancellor, the Shadow Chancellor, the Chief Secretary to the Treasury and the Permanent Secretary at the Treasury, who has reaffirmed his position today, have all said that a currency union is off the table."