The Spanish parliament has voted overwhelmingly against a referendum planned in Catalonia for independence.
The Catalan authorities requested parliament to give favourable consideration to the vote scheduled for 9 November.
Debate took seven hours and resulted in 299 MPs against and only 47 in favour. Support came from the Catalan and Basque nationalist parties but all the major Spanish parties opposed the referendum.
The Catalan President Artur Mas said the regional government was still going to proceed with the referendum.
Catalonia already has a hard-won autonomy, but after six years of economic crisis sweeping the whole country, many people in the region appear keen to break away.
Prime Minister Rajoy repeated his opinion that a referendum would be deemed illegal as Spanish law provides that independence referenda must be across the nation and not just one region.
His position is backed by Spain's constitutional court, which ruled last month that a referendum in the powerful north-eastern region could only take place if changes were made to Spain's constitution.
Mr Mas promised that the Catalan authorities will continue to search for legal mechanisms to further consultations.
The referendum, it was announced in December, will have two questions.
Voters would be asked if they wanted Catalonia to be a state and if they wanted it to be an independent state.
Catalonia is one of the most developed regions in Spain, with a population of 7.5 million.
The latest polls show that roughly half the people there support independence.