Immigration is being used as a "weapon" to stoke up fears about Scottish independence, First Minister Alex Salmond has said.

He accused opposition parties were "pandering" to UKIP instead of standing up to an anti-immigration message.

Mr Salmond has said Scotland would need an extra 2,000 immigrants a year to make pensions affordable.

Shadow pensions secretary Gregg McClymont dismissed the figure as "misleading"

The exchange came ahead of the 18 September independence referendum, and after the recent European elections, in which UKIP gained the most votes in the UK.

The first minister's comments came after he suggested Scotland would need to encourage immigration to help redress the balance between working people and pensioners.

Mr Salmond argued Scottish immigration needed to rise to 24,000 a year, and full control over tax and economic policy would allow Scotland to attract the right people to work in the country.

Scotland 2014 - What's on

Broadcaster Sarah Smith will be quizzing pro-Union backer, Labour MP Douglas Alexander, and independence-backer, Deputy First Minister Nicola Sturgeon later. You can watch Scotland 2014 live on BBC Two Scotland at 22:30. It's also available to view on the BBC news website. And if you miss it you can catch up on the BBC iPlayer.

"By contrast, the main Westminster parties have decided to deploy immigration as a weapon in their increasingly tawdry self-styled Project Fear campaign," he wrote in the Herald newspaper.

"The UK government and indeed the Labour Party is using an estimate that net annual migration to Scotland needs to rise to 24,000 to match or exceed the same ratio of working people to pensioners in the UK as if it were something to be frightened of - a reason to vote No."

He added that independence would allow Holyrood to reintroduce a post-study work visa, which was scrapped by the UK government.

He wrote: "As well as practical policies, we can jettison the aggressive language of the mainstream Westminster parties, who instead of standing up to the likes of UKIP have decided to pander to them, and in this independence referendum now to copy their tactics of engendering fear of immigration."

Extra immigrants

Mr McClymont, a Scottish Labour MP, said: "Alex Salmond should step away from the keyboard when he is angry late at night.

"It seems the nationalists can't help themselves misleading the people of Scotland about the consequences of separation.

"Immigration has been good for Scotland. People coming to work here from elsewhere in the world make a valuable contribution to our economy and culture.

"The fact is that being part of the UK makes pensions in Scotland more affordable. Expert opinion is clear that one million extra immigrants would be needed to fill this pensions black hole by the middle of the century."