The origins of the labor movement in Spain are located in Catalonia in the 1830s and 1840s, since it was the only place in Spain where there was a modern industry: the textile industry. There the first conflicts between workers and employers took place and there the first trade union — called "resistance societies" at the time — in the history of Spain, the Barcelona Weavers Association, was founded in 1840. The first general strike took place during the progressive biennium - a period of extension of the movement to other areas of Spain. By 1865, the first Workers' Congress was held in Barcelona. After the triumph of the Glorious Revolution, the right to freedom of association was recognized for the first time, which put an end, at least momentarily, to the persecutions and prohibitions that the incipient labor movement had suffered during the previous forty years.
With the formation in Spain of the first two groups of the International Workingmen's Association in 1869, one in Madrid and the other in Barcelona, a new stage in the history of the labor movement in Spain began, during which, as Manuel Tuñón de Lara said: "for the first time class consciousness was expressed at a level where the entire system of relations of production, institutions and values was called into question."
Last years of the reign of Fernando VII and regency of María Cristina (1821–1840) On March 2, 1821, there was a mutiny at Alcoy, during which 17 wool carding and spinning machines were burned. The rebels, some 1,200 men, also demanded that the remaining machines be dismantled. It was the first sample of Luddism in Spain, one of the first in continental Europe, and marked the first conflict of the new "industrial era". In 1823, several spinning and carding machines were destroyed in Camprodon, which led to the promulgation the following year of a Royal Order to prevent actions of this type.
The first modern labor disputes took place in Catalonia, as it was the only place where a modern industry existed: the textile industry. As early as 1827, workers complained that their employers lengthened the fixed length of the pieces to be woven, which forced the authorities to intervene. The same complaints were repeated in 1831, to which the employers replied that the workers did not have a day off on Mondays and thus they would earn more per week. Again the authority intervened, which set the maximum length of each piece at 35 canas.
In 1834 the workers in the textile sector complained again to the captain general of Catalonia about the employers' practice of lengthening the length of the pieces or reducing their wages. The Factory Commission responded that the workers "loaf", waste time eating sandwiches and drinking wine, in addition to denying that the bosses were cutting wages "at least in general." The captain general brought together two representatives from the Factory Commission and two from the Board of Commerce to recommend that instead of lengthening the length of the pieces when there was a crisis, they reduce the working days per week. The same demand was repeated in 1835 although this time the Board of Trade, after insisting on the principle of "freedom of contract" between the "manufacturer" and the "operator", recognized the low wages and that "indeed, a few manufacturers have demanded greater draft of the current to the fabrics". During the Burning of the Monasteries in July and August, the Bonaplata Factory was burned by the rioters, "convinced that the mechanical looms decreased the production of manual labor," according to the governor, General Pastor. Four workers were shot as alleged perpetrators and many others were sentenced to prison terms. In addition, the civil governor established work bases that included a factory inspection commission to which the workers should direct their complaints, suffering "the penalty of eight days of arrest" for workers who instead of going to it "moved a question in the field, factory or outside of it on the pretext that the manufacturer does not comply with what was ordered" in the work bases, and that if they repeated "they will be expelled from this city as a wayward man and harmful to society, notice will be circulated to all manufacturers so that they do not admit them to their factories, and if their actions give rise to a riot or riot, they will be handed over to the competent court as a disruptor of public order." After the fire at the Bonaplata factory, there were other cases of machine destruction, such as in Sabadell in 1836.
In those years the first attempts to form workers societies took place, as evidenced by the repeated complaints to the Factory Commission by employers against "unruly workers" or "ungrateful workers" and against "a kind of plot to ask for a wage hike" — a reference to what will later be called a strike - which showed according to Manuel Tuñón de Lara, "a new state of consciousness, characterized in that the worker feels the need to associate in order to achieve their labor or salary goals." At first they were temporary in nature with a specific purpose, but the workers' commissions formed to discuss demands with the employers asked the captain general of Catalonia to authorize them to become permanent associations. They also addressed the trustees of the Barcelona City Council. Thus, a commission made up of three workers interviewed them: "They spoke of the ease that the main manufacturers have of being able to join together in a banquet at the inn in Gràcia or elsewhere, due to their small number, dragging their opinion that of others, while the day laborers only needed the largest amount of publicity to understand each other."
Regency of Espartero (1840–1843)
In February 1839 a Royal Order was promulgated authorizing the formation of mutual aid societies and charities and subsequently the Barcelona Weavers Association was established, the first union in Spain.
The Weavers Association spread outside Barcelona, reaching 15,000 members, 7,000 from the capital and 8,000 from the towns of the province, and served as an example for the constitution of companies in other trades, such as spinners and dyers. As Josep Termes has pointed out, from the foundation of the Weavers Association "a social labor movement was born, based on the so-called societies of resistance, which trace the structure of the old trade guilds, but reject their organizational form based on the existence of teachers, officers and apprentices, all of them replaced by the new category of factory and trade worker, who is a salaried worker."
However, the government of Baldomero Espartero prohibited the Association on December 9, 1841 however it was reauthorised "on condition that it was apolitical and local." On January 16, 1843, it was again declared dissolved following the Barcelona uprising in November 1842 and the bombardment of the city but continued to operate clandestinely.
Moderate Decade (1844–1854) In the following years some mutual aid societies appeared outside of Catalonia, such as so-called "Workshop" of Valencia or the "Mutual Aid Society among Weavers of Béjar". Likewise, workers' cultural associations were founded, such as "La Velada de Artistas, Artesanos, Jornaleros y Labradores", established in Madrid in 1847, which later adopted the name of "Fomento de las Artes" or the popular orfeón composed of workers founded in Barcelona by Anselmo Clavé in 1850. Adult schools were also organized, such as the one founded in Madrid by Antonio Ignacio Rivera, which had 400 students and published a newspaper, El Trabajador — where they published works by Francesc Pi i Margall and Sixto Cámara.
Progressive biennium (1854–1856)
On June 30, 1854, the pronouncement known as the Vicalvarada broke out, which began the progressive biennium. The first city to join was Barcelona, where on July 14 an uprising began in which the workers played a prominent role, who for the first time did so by declaring a strike. The outcomes was that the spinners got half an hour more time in the lunch break, which meant reducing the weekly hours from 75 to 72.
There was also an important labor participation in the uprising in Málaga, forcing the civil and military governors to leave the city. A Board elected by universal suffrage was then formed, and the workers went on strike for several days until they achieved the wage increases they were asking for.
The following year, labor unrest grew. On April 30, the civil governor of Barcelona prohibited both the closures of factories by employers and the "collective abandonment of work" by workers, in addition to establishing the requirement of government authorization so that workers' associations could continue to function. Three weeks later, on May 21, a Royal Order on "freedom of contract" annulled what the workers had achieved in the agreements of the previous summer. In this context, on June 6, took place the trial and execution of José Barceló - head of the Barcelona Spinners Association - as "instigator" of a crime committed at Mas de Sant Jaume, near Olesa de Montserrat, the court counting only on the evidence of a last minute statement of one of the perpetrators of the robbery and murder, when he was awaiting execution. On June 21, the captain general Juan Zapatero took the final step in the offensive against the workers' associations by prohibiting them. Eleven days later the first general strike in the history of Spain was declared in Barcelona. As the workers' delegate Juan Alsina said months later: "If Zapatero had not given the order to prohibit associations, the working class would have remained calm in their workshops awaiting the decision of the exhibition that dated May 11 of 1855 he had raised the Government asking for a remedy for his ills."
The strike began at lunchtime on July 2, when workers from Barcelona, Gràcia, Badalona, Sants and other towns in the periphery - like Igualada - left the factories. Even the bishop of Vich joined in the calls made by the authorities to return to work: "If in your laborious life you have to subject yourself to some deprivation, religion teaches us resignation and suffering, religion consoles us, promising us more abundant happiness for a life to come, the greater the privations in the present." But the strike continued under the slogan written on a banner: "Long live Espartero! Association or death! Bread and work!"
On July 5, two commissions left for Madrid to meet with the president of the government, Baldomero Espartero, from whom they were going to ask for the recognition of the right of association, the ten-hour day, and the constitution of a jury made up of workers and employers. Espartero received them coldly saying to "the sons of the people, my favorites" that their demands would be met if they put an end to the strike. On July 8, Barcelona began to regain normalcy, by opening part of the business and resuming work in offices and courts. By then the repression had already begun: the frigate "Julia" left for Havana with seventy arrested workers on board. On July 9 there were demonstrations on the Ramblas and Army units took up positions in the working-class neighborhoods. The factories opened but almost no worker returned to work.
Then Colonel Saravia arrived in Barcelona, envoy of General Espartero, who maintained the support of the popular classes, who finally succeeded in bringing the strike to an end on July 11 by making vague promises and setting up a mixed jury. "Sarabia in his office to the Government, boasted that the principle of authority was unscathed, that the prisoners would serve their sentences and if they had not made concessions."