The Union Jack flies in Scotland. Andy Rain / EFE

That’s the position of the Spanish government, which was outlined by Foreign Minister Alfonso Dastis in the Peruvian capital of Lima on Monday during the first leg of a Latin American tour. Were Scotland to become independent, following a 2018 referendum that was proposed this week by Scotland’s first minister, Nicola Sturgeon, the country would be treated as a third state and would have to get in line to join the EU.

Spain will not “encourage any secessionist movements” within the European Union

Clearly referring to the demands of pro-independence parties in Catalonia, Dastis said that Spain would not “encourage any secessionist movements” in Europe. The tough stance comes as no surprise: Spain is one of the few European countries not to have recognized Kosovo’s independence almost two decades after a NATO campaign separated the mainly Albanian province from the rest of Serbia. The message is clear: an independent Catalonia, even hypothetically speaking, would start life out in the cold, unprotected economically and institutionally by the EU, or militarily by NATO.

At the same time as Madrid is refusing to accept the idea of an independent Scotland, it says it might be prepared to make an exception in the case of Northern Ireland on the basis of its special relationship with the Republic of Ireland and the fact that an open border between the two parts of the island are fundamental to the 1998 Good Friday agreement that brought an end to three decades of violence between Catholics and Protestants. Spain is prepared, under certain conditions, to look into maintaining the free movement of people between the two Irelands, which would become an EU border following Brexit.

Spain might consider a special status for Gibraltar

But while Scotland cannot be compared to Catalonia, neither can Northern Ireland be likened to Gibraltar, says Madrid. Dastis made it clear that the formula Spain is prepared to apply to Ulster cannot be transferred to “The Rock.” Gibraltar, whose territorial jurisdiction statutes means its foreign affairs are decided by London – it is a non-self-governing territory pending decolonization, according to the United Nations – would leave the EU with the United Kingdom, and the frontier between Spain and Gibraltar would become an EU foreign border.

Spain is prepared to look into a special status for the British Overseas Territory, in part to facilitate the movement of thousands of Spaniards who work in Gibraltar, but that would require a bilateral agreement between London and Madrid to be conducted separately to the Brexit negotiations.