Spanish MPs have voted overwhelmingly to reject a request by the Catalan authorities to hold a referendum on independence on 9 November.
After seven hours of debate, 299 MPs voted against the motion, with 47 votes in favour and one abstention.
Spanish PM Mariano Rajoy earlier warned a referendum would be "an economic disaster" for both Spain and Catalonia.
Plans to let the people of the eastern region break away from Spain has led to months of constitutional debate.
The region already enjoys a wide degree of autonomy but the recent economic crisis in Spain has fuelled Catalan nationalism.
'Not the end'
All of the major Spanish parties, including Mr Rajoy's conservative Popular Party and the Socialist opposition, opposed the petition, with Catalan and Basque nationalist parties voting in favour.
Prime Minister Rajoy repeated his argument that a referendum would be considered illegal because, under Spanish law, referendums on sovereignty must be held nationally and not regionally.
"Together we all win, but separate, we all lose. This isn't just a question of law, but of sentiment... I can't imagine Spain without Catalonia, or Catalonia out of Europe." he told parliamentarians in a debate prior to the vote.
But, speaking after the votes were counted, Catalan President Artur Mas said his regional government would press ahead with the plan to hold a referendum in November.
"Some would like to present this as the end of the matter but, as president of Catalonia, I say to them that it is not the end," he said.
The Catalan authorities will search for legal mechanisms to find a way to continue consultations on the referendum, he added.
Tensions between the Spanish government and Catalonia's regional government have been rising in recent months.
Catalan's regional government announced in December that it had decided on the two questions that would be put to the electorate.
Voters would be asked if they wanted Catalonia to be a state and if they wanted it to be an independent state.
The Catalan regional authorities have a long history of fighting the central authorities in Spain for greater autonomy.
Catalonia is one of Spain's most developed regions, with a population of 7.5 million.