The BBC sees itself as a "unionist institution", according to a former BBC editor who accused the broadcaster of propaganda during the independence referendum campaign.

Paul Mason, former economics editor for Newsnight and subsequently for Channel 4 News, said the BBC is led by unionists with a neoliberal point of view.

Former first minister Alex Salmond, who chaired a discussion with Mr Mason at the Edinburgh Book Festival, said his own perception of bias at the BBC was a "blind spot" that he did not factor into his independence strategy.

He compared Permanent Secretary to the Treasury Sir Nicholas Macpherson to a Bond villain, repeating his allegation that Sir Nicholas abandoned his commitment to civil service impartiality by actively working against independence.

Sir Nicholas reportedly leaked an internal memo suggesting RBS may move out of Scotland if it votes for independence in the closing days of the referendum campaign.

On that day Mr Mason, who had left the BBC a year earlier, told Facebook followers: "Not since Iraq have I seen BBC News working at propaganda strength like this. So glad I'm out of there."

Speaking at the Edinburgh Book Festival, Mr Salmond said: "The Treasury didn't surprise me. The chief executives of a number of companies didn't surprise me in the slightest.

"But the BBC did surprise me, and that's because my experience of elections, and again in the elections held this year, is that while politicians complained about this and that, by and large, on the whole the television coverage in this country is pretty fair and square.

"It wasn't like that during the referendum, and that I confess did surprise me and that was a blind spot which perhaps I should have seen but didn't see.

"I thought the coverage of the referendum would be like the coverage of an election."

Outgoing BBC political editor Nick Robinson used his own platform at the Book Festival to accuse Mr Salmond of vilifying him as "a symbol of the wicked, metropolitan, Westminster classes sent from England, sent from London, in order to tell the Scots what they ought to do".

Mr Salmond acknowledged that he and Mr Robinson are "in a dialogue", but said "it's a much bigger issue than Nick Robinson".

"He was just the instrument of the day rather than the underlying issue," he said.

Mr Mason said: "I have this theory about the BBC, that what most people don't like about it is to do with the social group from which its managers and senior people are recruited.

"I'm not even talking about politics, I think it's an outlook on life."

He said they will "nearly always be unionist, nearly always be of a neoliberal point of view".

"I'm absolutely sure that the BBC believes it is a unionist institution," he said.

"It thinks if Scotland becomes independent there is no provision for a Scottish independent BBC so in its DNA it's a product of this polity."