Jose-Manuel Garcia-Margallo said that while his government would not interfere in the wider debate on independence, there would be a "mountain of problems" to resolve for Scotland to take a place in its own right.
"We don't interfere in other countries' internal affairs. If Britain's constitutional order allows - and it seems that it does allow - Scotland to choose independence, we have nothing to say about this," he told the Financial Times newspaper.
But Scotland would have to "join the waiting line" and ask permission for EU membership, he claimed while name-checking the Better Together campaign to keep Scotland in the UK.
"They have to resolve a mountain of problems, as Better Together has explained very well," he said.
"You have to achieve candidate status. You have to negotiate 35 chapters . It has to be ratified by the institutions of the EU. It then has to be ratified by 28 national parliaments."
The SNP said the Spanish foreign minister's promise to keep out of internal affairs shows common sense.
Deputy First Minister Nicola Sturgeon said: "This is very welcome confirmation of the common sense approach which will prevail following a Yes vote in September's referendum.
"Scotland is already part of the EU and as such already complies with all the rules and terms of membership.
"Scotland's referendum is enshrined in the Edinburgh Agreement, which commits both the Scottish and UK Governments to respecting the result and working in everyone's best interests afterwards - so there is no question that it is 'legal' and that it passes that test in terms of the view of the Spanish government.
"Scotland's continued EU membership as an independent country is overwhelmingly in the interests of the rest of Europe, and the rest of the EU will be keen to ensure Scotland remains a part. That is not only our view, it is one shared by hugely respected experts like Graham Avery and Sir David Edward.
"Scotland is a European nation, and if the people decide we should be independent we will have equal status and a place at the top table in Europe for the first time ever."
Mr Garcia-Margallo spoke out in similar terms two years ago about staying out of UK-Scotland affairs. But since then, Spanish prime minister Mariano Rajoy intervened on Scotland's possible EU accession.
Mr Rajoy, speaking in November, said: ''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."
The Spanish government is facing its own constitutional debate with a push in Catalonia for independence. But tensions are higher there because Madrid has ruled out supporting a legal referendum.
Better Together leader Alistair Darling said: "The Spanish foreign minister has confirmed, yet again, that the negotiations to get back into the EU would be tortuous and would take a long time. And what's more, it could be blocked by just one country.
"There would be a lot of uncertainty for business during this period. Something that we absolutely don't need.
"This blows a hole in the nationalist claims in their White Paper that it would all be plain sailing. Every analysis says that it wouldn't be. It is time that the nationalists admitted it."