Spain has long been seen as an obstacle to an independent Scotland joining the EU to deter separatists in some of its own regions.
"Initially, I don't think we would block it," Alfonso Dastis said in an interview published on Sunday.
However, he added Scotland would leave the EU with Britain, "the rest we will see."
He also said Spain did not welcome fragmentation of the European family.
"Having said that, if, in application of its laws, the outcome of that process is a division of the United Kingdom, any part of the United Kingdom that becomes a state and wants to join the EU will have to apply. And follow the steps that are stipulated".
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.

