The prime minister of Spain said Sunday that if Scotland wins independence from the United Kingdom in 2014 it will have to leave the European Union immediately and reapply to come back in, provided current member states approve such a move.

Mariano Rajoy’s comments were also designed to be a sideswipe at Catalan nationalists who hope to hold a similar vote on secession and are watching Scotland’s progress carefully.

"This is a fact, it's neither a value judgment nor an opinion, it's simply a fact. If part of a country integrated into the European Union leaves that country, then logically it would be outside the European Union, not because I say so, but because that's what the treaties say," said the Spanish premier in interviews with European newspapers.

Rajoy's line directly contradicts Scottish First Minister Alex Salmond, who has repeatedly said that Scotland would be able negotiate its position from inside the EU as part of the UK’s membership rather than having to join as a new country.

"The Scottish government recognizes that membership of the EU will require negotiations with other member states and the EU institutions in order to agree the terms on which an independent Scotland will become a full member of the EU," said Deputy First Minister Nicola Sturgeon. 

"We also believe -- and this has been echoed by independent experts -- that these negotiations could be completed within the 18-month period between a yes vote in September next year and day one of independence in March 2016, ahead of the May parliamentary elections."

Sturgeon said Rajoy's comments are based on a very loose interpretation of Article 48 of the EU Treaty, which she says would allow Scotland a seamless transfer into the European Union. 

EU ministers have refused to be drawn on the issue and are waiting to see the outcome of the referendum, which is due to take place in September 2014. 

Since coming to power nearly two years ago, Rajoy has tried to dampen Scottish nationalists by using the issue as a proxy to attack the Catalonian separatist movement. He stopped short, however, of saying he would use Spain’s veto to block Scotland from rejoining if it had to. "We would be in a different story. Let's not get ahead of ourselves," he said.

While it appears Spain is siding with the UK as they both seek to contain nationalistic uprisings, tension continues between the two countries regarding the British Overseas Territory of Gibraltar, which stands as a distraction from economic woes and the ongoing corruption issues for Rajoy's party.