BARCELONA, Spain — Spain’s leader fired the government of the rebellious Catalonia region Friday, dissolved the regional parliament and ordered new elections after Catalan lawmakers illegally declared an independent nation.

The showdown escalated the biggest political crisis in decades to hit Spain, which is just emerging from a prolonged economic malaise. Catalonia is a critical part of the economy in Spain, the fifth largest in Europe.

“We never wanted to reach this situation, never,” Prime Minister Mariano Rajoy said on television, announcing the emergency steps he was taking under the Constitution to crush Catalan independence.

Mr. Rajoy’s move capped a frenzied day of political maneuvering in Madrid, Spain’s capital, and Barcelona, the capital of Catalonia, where the long drive for independence — illegal under Spain’s Constitution — has now reached its fiercest level yet.