Independence referendums in Scotland or Spain's Catalonia region are like a torpedo to European integration, PM Mariano Rajoy has warned.
He told MPs such processes created "more economic recession and poverty".
Pro-independence Catalans are watching Scotland's referendum on independence on Thursday closely, with plans for a similar vote in Catalonia in November.
If Scotland backed independence, it would have to reapply to the EU as a new member state, Mr Rajoy said.
'Torpedo below the waterline'
Catalonia's regional parliament is set to vote on a resolution on Wednesday that could pave the way for a November referendum on independence from Spain.
Last Thursday, hundreds of thousands of Catalans formed a "V" for "vote" along two of Barcelona's main roads calling for their right to vote.
But Spain's national government is opposed to any move towards independence and its blessing is constitutionally required to make a referendum legal.
Speaking to members of parliament on Wednesday, Prime Minister Rajoy described referendums like the Scottish example as "a torpedo below the waterline for European integration".
He said the spirit of the age was integration, and not separation, which was why he would find it very difficult to agree to holding a referendum.
If Catalonia's parliament does pass a law allowing a "consultation vote", Spain's constitutional court is widely expected to declare it "illegal".
Catalonia's President Artur Mas has previously promised to hold a vote on 9 November.
He told the BBC last week that he hoped Scotland would vote "yes" in its referendum, as he believed an independent Scotland would be accepted into the EU, proving that an independent Catalonia could expect the same.
But Prime Minister Rajoy said that Scotland would have to undergo all of the processes that apply to any new state in joining the EU.
He said it was clear under EU treaties and from statements from European leaders that "if a part of a state becomes separate, it becomes a third party in relation to the European Union".
For "separate territories within a member state" to join the EU would take years and depend on the ratification of all 28 member states, he added.
Mr Rajoy has previously suggested that he might block Scotland's entry into the EU.
Catalonia is one of Spain's richest and most highly industrialised regions, and also one of the most independent-minded.
Until recently, few Catalans had wanted full independence, but Spain's painful economic crisis has seen a surge in support for separation.