In the first third of the 20th century, Catalonia several times enjoyed and lost varying degrees of autonomy like other parts of Spain until the Second Spanish Republic confirmed the autonomies of Spain's traditional autonomous regions, including the autonomy of Catalonia and the official use of its language. Like Madrid, the Basque country and much of Spain, Catalonia fought hard to defend the Second Spanish Republic in the devastating civil war of 1936–1939. With the defeat of the Spanish Republic by the right wing forces of Francisco Franco, the autonomies were cancelled.