The move was widely expected after Prime Minister Mariano Rajoy announced that the government would challenge both a controversial law meant to legitimise the independence vote and a decree signed on Wednesday by the Catalan regional government summoning voters for the October 1 ballot.
On Wednesday, Catalonia's regional parliament, which is controlled by separatists, voted to push ahead with the referendum in the wealthy northeastern region, sparking the country's deepest political crisis in 40 years.
The central government called the move an attack against Spain's and Catalonia's institutional order.
"That's something that the government and the courts can't allow," Rajoy said in a televised address on Thursday after a meeting of his cabinet.
"There won't be a self-determination referendum because that would be taking away from other Spaniards the right to decide their future."
The reaction to the court's decision by leaders in Catalonia also did not come as a surprise.
Carles Puigdemont, the region's president and one of the main promoters of the referendum, said that neither central Spanish authorities nor the courts could halt their plans.
Spain's constitutional court has previously ruled that a referendum can only be called with the approval of the central authorities.
But Puigdemont's pro-independence coalition claims that the universal right to self-determination overrules Spain's laws.
"We will respond to the tsunami of lawsuits with a tsunami of democracy," Puigdemont told local broadcaster 8TV.
He also boasted that more than 16,000 people had already registered online as volunteers and that more than half of the mayors in Catalonia were supporting the vote.
The Catalonia region, centred on Barcelona, generates a fifth of Spain's gross domestic product and holds 7.5 million people. It self-governs in several important areas, such as police, health and education.
But key areas such as taxes, foreign affairs and most infrastructure are in the hands of the Spanish government.
Both Catalan and Spanish are spoken, and many Catalans feel strongly about their cultural heritage and traditions.
Lawsuit against officials
The state prosecutor, meanwhile, announced plans for lawsuits accusing Catalan officials involved in the possible referendum of disobedience, abuse of power and embezzlement, among other charges.
One lawsuit seeks to punish members of the Catalan Parliament who allowed the debate and the vote on the legal framework of the referendum.
A separate lawsuit was aimed at Puigdemont and the other members of his cabinet who signed the referendum decree.
Chief state prosecutor Jose Manuel Maza said prosecutors and police forces in Catalonia had been told to investigate and stop any actions taken to celebrate the referendum. Businesses who print tickets for the ballot, produce commercials to advertise it or provide ballot services to the Catalan government could also be legally liable.
He said the measures were aimed at "guaranteeing the constitutional coexistence framework" in Spain.