During the Spanish Civil War, there were three governments. The first was led by left-wing republican José Giral (from July to September 1936); however, a revolution inspired mostly on libertarian socialist, anarchist and communist principles broke within the Republic, which weakened the rule of the Republic. The second government was led by socialist Francisco Largo Caballero of the trade union General Union of Workers (UGT). The UGT, along with the Confederación Nacional del Trabajo (CNT), were the main forces behind the aforementioned social revolution. The third government was led by socialist Juan Negrín, who led the Republic until the military coup of Segismundo Casado, which ended republican resistance and ultimately led to the victory of the nationalists, who established a military dictatorship under the rule of Francisco Franco, known as Francoist Spain.