"It is very clear to me, and to the rest of the world, that if a region chose to become independent from an EU member state, then that country is outside the EU," said Mariano Rajoy during a joint press conference with French President François Hollande.
"It's good for people in Scotland to know this, and for EU citizens to know this," he added.
The Spanish Prime Minister's words came one day after Scotland's First Minister Alex Salmond launched a 670-page White Paper on Scottish independence. Scotland will hold a historic vote on whether to become independent from the UK in September 2014.
The comments from Rajoy also reflect comments made by European Commission President José Manuel Barroso. Barroso on Tuesday said that new states would have to reapply for EU citizenship.
Rajoy's comment are therefore another blow to Scotland's hopes of automatic entrance into the EU.
But many Spanish media outlets believe the prime minister's comments were actually directed at Catalonia, which, like Scotland, has independence ambitions.
In an article titled 'Rajoy uses Scotland to send a warning to Catalonia', Spain's El País newspaper said the prime minister had used Barroso's comments to warn Catalonia on the dangers of independence.
"The times we are living through call for strong countries," said Rajoy on Wednesday.
"It doesn't benefit anyone if our regions create divisions are go out on their own towards an uncertain future, where the exit point could appear clear but the destination is unknown," he added.
Spain's left-wing El Periodico newspaper, meanwhile, pointed out that while Rajoy "did not mention Catalonia" once on Wednesday, he had "come prepared with a long written answer to answer (questions)" on independence.
This was "a clear allusion to the claims of pro-independence Catalans" the paper said.
Catalan daily La Vanguardia also saw the Spanish PM's message is aimed primarily at Catalonia. "It's not easy" to obtain EU membership status after independence because it's necessary to request entry and be accepted "unanimously" by member states," the paper quoted Rajoy as saying.
Catalonia in Spain's north east has a distinct culture from the rest of Spain, and its own language.
On the region's September 11th national day, a pro-independence human chain stretched hundreds of kilometres and joined hundreds of thousands of people.
Catalonia has plans to hold a self-determination referendum. But Rajoy's government insist a referendum in Catalonia — a wealthy region home to about 7.5 million of Spain's 47 million people — would be unconstitutional.