But Catalan's leaders vowed to go ahead with it, even after the nation's top court intervened at the central government request in an effort to prevent the vote.
Rajoy promised earlier in the day he would do "all that is necessary" to prevent the plebiscite in the wealthy northeastern region from being held.
Catalonia's regional parliament, which is controlled by separatists, voted Wednesday to push ahead with the referendum in the wealthy northeastern region, sparking the country's deepest political crisis in 40 years.
"This referendum, no matter how much they try to impose it in a hasty, amateur and illegal way, will not take place," Rajoy said.
He said all 947 mayors in Catalonia would be warned over their "obligation to impede or paralyse" efforts to carry out the vote which he said is unconstitutional.
- Spanish court blocks Catalan indepenedence referendum
- Thousands rally in support of independence bid
- Spain's asks Constitutional Court to block referendum
As was widely expected, Spain's Constitutional Court suspended the texts passed by the Catalan parliament to stage the referendum while judges consider arguments that the vote breaches the country's constitution.
According to court regulations, the suspension lasts for five months while judges come up with a ruling.
The court has since 2014 declared regional independence referendums to be unconstitutional. But Catalan authorities routinely ignore the court's decisions because they do not recognise its legitimacy.
Spain's top prosecutor meanwhile said voting materials would be seized and "criminal charges are being prepared" against the leaders of the Catalan parliament as well all members of the regional government for signing the referendum decree.
General prosecutor Jose Manuel Maza told reporters the officials could be charged, among other things, with disobedience, abuse of power and embezzlement.
Maza called on police to seize anything that could be used in the voting and accused Catalonia's government of "blatantly disobeying" repeated rulings by Spain's Constitutional Court against steps to hold an independence referendum.
'Tsunami of democracy'
The warnings were brushed aside by Catalonia's president Carles Puigdemont, who said 560 municipalities had already committed their support for the referendum, and 16,000 volunteers have registered to help with the vote.
He had sent a letter to Catalonia's mayors on Thursday asking them to give notice within 48 hours of what locations they could make available for ballot stations.
"No cabinet, no discredited court will suspend democracy in Catalonia," Puigdemont, a lifelong proponent of independence, said during an interview with Catalan TV.
"In the face of the tsunami of lawsuits there will be a tsunami of democracy," he added.
Shortly after midnight Friday, the separatist majority in Catalonia's regional parliament voted a second controversial law which outlines the terms of a transition to a Catalan Republic, independent from the Kingdom of Spain.
The law is meant to take effect only if the separatists win the referendum.
Catalonia accounts for about one-fifth of Spain's economic output, and already has significant powers over matters such as education and healthcare.
But Spain's economic worries, coupled with a perception that the region pays more in taxes than it receives in investments and transfers from Madrid, have helped push the cause of secession from the fringes of Catalan politics to centre stage.
Adding to the rise in separatist sentiment was a 2010 ruling by the Constitutional Court striking down parts of a 2006 autonomy charter which granted new powers to Catalonia and recognised it as "a nation".
'Won't be recognised'
Opinion polls show that Catalans are evenly divided on independence. But over 70 percent want a referendum to take place to settle the matter, similar to the plebiscite held in Scotland in 2014.
The president of the European Parliament, Antonio Tajani, warned that an independent Catalonia would be left outside of the European Union.
Caroline Gray, an expert on Spanish independence movements at Britain's Aston University, said the referendum would lack legitimacy if it goes ahead since people who oppose independence would likely stay home just as they did during a mock referendum in 2014.
Over 80 percent of participants voted to split from Spain during that symbolic plebiscite -- though only 2.3 million of Catalonia's 5.4 million eligible voters took part.
"If we look at it from how Spain and the international community is going to react, I think it is difficult to see how people will take it more seriously than previous attempts which did not work," Gray told AFP.
"It would be very difficult for the Catalan government to get to the stage to be able to proclaim independence because it won't be recognised beyond its own authorities."
By Daniel Silva with Daniel Bosque in Barcelona / AFP