The Spanish prime minister has said Scotland would have to apply to the European Union as a new state if it votes for independence.

Mariano Rajoy's comments came as Deputy First Minister Nicola Sturgeon set out further details of the SNP administration's aim to negotiate entry from within the EU in the 18 months between a Yes vote and formal secession from the UK.

Mr Rajoy reportedly told a press conference in Madrid this evening: "I would like to see the consequences of secession presented to Scots in a realistic way. Citizens have the right to be well informed.

"If part of a Member State becomes independent, it would be left out of the European Union, and it would be good for citizens (in the EU) and Scots to know that.

"EU entry would need to be approved by all 28 Member States."

Mr Rajoy's intervention comes as the Spanish government faces its own independence movement in Catalonia.

The Scottish Government's White Paper on independence devotes about nine pages of the document to EU membership and a further 100-page publication which focuses on the EU has also been released by the Scottish Government.

Writing in its foreword, Deputy First Minister Nicola Sturgeon said the government recognises EU membership will require negotiations with other member states and institutions but believes it could be done from within the organisation in the period between a Yes vote in September next year and day one of independence in March 2016.

The report asserts that it is wrong on three counts to say Scotland would have to leave the EU and reapply from outside.

Scotland has been an integral part of the EU for 40 years. It would be against the self-interest of the EU collectively and individually and it would deny the democratically expressed wishes of the people, the report concludes.

A spokesman for the Deputy First Minister said: "Scotland's future is first and foremost a matter for the people of Scotland. We note that the Spanish Prime Minister has said he has not read our proposals, but Mr Rajoy has previously indicated that he considers the Scottish and Catalan situations are 'absolutely and totally different'.

"That is because the process for Scotland becoming independent is enshrined in the Edinburgh Agreement, where the UK Government has pledged to respect the outcome of the referendum.

"As the papers we have published outline, we have detailed a process which will see Scotland negotiate its position as an independent member of the European Union from within, during the 18-month period between a Yes vote and independence day - a period when we will still be part of the EU as part of the UK, and which has been described as 'realistic' by the UK Government's own legal adviser.

"That process, under Article 48 of the Treaty of the EU, allows for Scotland to become a member state at the point of independence.

"Scotland is already an integral part of the EU, and there is nothing in the entire body of EU treaties which provides for the expulsion of an existing territory or the removal of its inhabitants' rights as EU citizens."

The spokesman said the only "serious threat" to Scotland's continued EU membership comes from the UK Government's proposed in-out referendum.

Better Together leader Alistair Darling said Mr Rajoy's comments were "another blow to Alex Salmond's claims that nothing would change if we vote to go it alone".

He added: "The Spanish Prime Minister has just made it clear that everything would change.

"We now know what the position of the Spanish government would be if we vote for independence. This has created even more uncertainty."

Scottish Conservative leader Ruth Davidson said: "The Spanish Prime Minister has just blown Alex Salmond's case for EU entry out of the water.

"We need to know what advice the SNP received before they laid out their threadbare case in the White Paper, whether they'd spoken to other member states or even checked basic facts with EU officials.

"It seems the First Minister has been playing fast and loose with the facts on EU entry and has been spectacularly caught out."