Protests erupted in Catalan cities as well as Madrid on Wednesday after Spanish authorities ramped up their efforts to thwart the northeastern region's upcoming independence referendum by storming ministries and seizing nearly 10 million ballot papers and detaining at least a dozen high ranking local officials.

Protesters in Barcelona, the region's capital, held signs reading "Freedom for Catalonia" and shouted "We will vote" and "Occupying forces out."

The Spanish government has declared the Oct 1. referendum on self-determination illegal. It has already conducted seizures of campaign materials and warned "last week that officials engaged in any preparations for it could be charged with civil disobedience, abuse of office, and misuse of public funds," Reuters reported.

The Associated Press reports:

Police acting on a judge's orders searched 42 premises, including six regional government offices, officials' private offices and homes, as well as three companies in Barcelona, the city's superior court said in a statement. It said some 20 people are under investigation for alleged disobedience, abuse of power, and embezzlement related to the referendum.

Police and judicial authorities declined to give further details of the operation, which aimed to halt preparations for the vote, saying a judge has placed a secrecy order on it.

"We're no longer discussing whether Catalonia has independence. We're discussing whether Spain has democracy and freedoms or not."

—Ramón Espinar Podemos, PodemosSpeaker of the Catalan parliament, Carme Forcadell, said latest actions "open the door to repression" and were a "flagrant violation of the rights of citizens."

Catalan President Carles Puigdemont denounced (pdf) what he described as "coordinated aggression" that "has no legal basis" and "was perpetrated by violating the rule of law, all constitutional guarantees, and violating the European Union Charter of Fundamental Rights."

"In these last hours, and especially today, the Spanish state has suspended de facto Catalonia's self-government and has applied a de facto state of emergency. Liberties are being suspended and repressed," his statement said.

He added in a tweet that the region would "not accept a return to the darkest times."

Given the escalated situation, Ramón Espinar Podemos, a social activist and politician with the Podemos political party, said from the protest in Madrid that "we're no longer discussing whether Catalonia has independence. We're discussing whether Spain has democracy and freedoms or not."

Prime Minister Mariano Rajoy, for his part, defended the actions, telling lawmakers: "The government is doing what it has to do," and "we will keep doing that until the very end."

But according to Barcelona Mayor Ada Colau, "If Rajoy persists with this repressive strategy, he'll find diverse, pro-Catalan voices more united than ever defending rights and freedom."

Among the chorus calling for a defense of democracy in the face of the crackdown were Podemos Secretary-General Pablo Iglesias and Madrid mayor Manuela Carmena.

Carmena tweeted that "[C]rises in democracy are fought with more democracy," while Iglesisas tweeted, "Suspending civil rights will worsen the problem," which can "only be solved politically."