Prime Minister Mariano Rajoy wielded emergency powers granted by the Spanish Senate at once on Friday, dismissing the Catalan government and dissolving its parliament, as he sought to restore control of the rebel region.

In a televised statement, Rajoy called regional elections for Dec. 21 in a bid to draw a line under weeks of upheaval in the country’s biggest regional economy that saw hundreds of businesses shift their domicile to other parts of Spain to escape the turmoil. He also fired a police chief from the regional force, shut down most of the Catalan government’s diplomatic service and eliminated the offices of president and vice president. Rajoy created a special department in Madrid to oversee the measures.

The Catalan Parliament earlier in the day approved a declaration of independence during an improvised plenary session that saw lawmakers depositing their votes in a ballot box as they tried to shield themselves from legal repercussions from the Spanish courts.

“They tried to stage a kidnap and steal part of the community from the people,” Rajoy said. “Now it’s about trying to minimize the damage.”

Catalonia’s tumultuous push to break away from Spain reached a climax on Friday with opposition lawmakers in the regional legislature accusing the separatists of trampling due process in their rush to proclaim a new state, before walking out in protest. During the final 48 hours, Catalan President Carles Puigdemont had zig-zagged, shaping to trigger elections himself before backing away in the face of an angry backlash from supporters on the streets of Barcelona.

Resistance on the Streets

“We have to expect a certain amount of resistance from those affected by the situation,” Josep Pique, a former colleague of Rajoy’s in Jose Maria Aznar’s government and a Catalan, said in an interview before the details were announced. “There will probably be insubordination and the government will have to use the resources that it has, the legitimate use of force. That could generate problems of public order which will have to be managed.”

In the run up to the Catalan plenary, pro-independence activists had called for a human shield around government buildings to thwart Spanish efforts to take control and protect their representatives. As lawmakers debated in the chamber, thousands flooded the streets around the parliament and greeted pro-independence mayors shouting "republica" and "we’re not scared" in Catalan.

"Its been worth it, the republic is here and now our duty is to defend it from Madrid," said Guillem Jove, 22, a student who had waited since noon outside the parliament. "Rajoy will try to suppress us -- but the streets our ours."

European Support

European leaders lined up to support Rajoy. German government spokesman Steffen Seibert urged both sides to consider all options for dialogue and de-escalation. The semi-autonomous Scottish government, which held a referendum in 2014 on breaking away from the U.K., echoed the call for talks, though said Catalans must have the right to determine their own future.

“There’s the rule of law in Spain, with constitutional norms,” French President Emmanuel Macron said, according to Agence France-Presse. “Prime Minister Rajoy wants them to be respected and he has my full support.”

European Union President Donald Tusk said on Twitter that nothing has changed in policy toward Catalonia and Spain "remains our only interlocutor." He said he hoped the Spanish government "favors force of argument, not argument of force.”