The Barcelona of 1842 was a keg of social conflict. Amongst the issues was the free trade policy of the regent General Espartero and the damage it was causing to the textile industry and the livelihood of workers. Another simmering issue was the tax required to be paid for bringing food into the city (). A climate of permanent tension existed in the city that foreshadowed an eventual explosion of violence.
The trigger came when a group of some 30 workers returning to the city on 13 November 1842 tried to smuggle a small amount of wine into the city without paying the tax. An uprising spread like wildfire, and within hours the working classes of the city had taken up a war footing. The Government's reactions inflamed the civil revolt which quickly brought together interests across the social strata (including the industrialist Joan Güell (father of Eusebi Güell) and the Marquis of Llió) in opposition to the Government. The local militia ("Patuleyas") also took part and by the 15th the streets had been barricaded and the army had to take refuge in the Montjuic Castle and Parc de la Ciutadella after suffering possibly up to 600 dead and wounded. 
After 3 weeks, the Government still refused to negotiate and the '"Bombardment of Barcelona"' occurred on 3 December 1842. It was ordered personally by General Espartero who had gone to Barcelona to put down the uprising.
 The Castle thereby acquired a new role that it would exercise for half a century: the repression of insurrections. The indiscriminate artillery bombardment of the city was made from Montjuïc under the command of Captain General Antonio Van Halen. The cannons fired 1014 projectiles and caused at least twenty deaths and widespread destruction throughout the city (some 462 buildings). 
Context.
The reign of Isabella II (1833-1868) was seen as very troubled as she first came to the throne as an infant. Her succession was disputed by the Carlists, who refused to recognize a female sovereign, leading to the Carlist Wars. Isabella’s failure to respond to growing demands for a more progressive regime contributed to the decline in monarchical strength.
The Carlist Wars were a civil war in Spain that was fought between factions over the succession to the throne and the Spanish monarchy. The First Carlist War was one of the major stepping stones that led to the bombardment. The Carlist force was made up of all who opposed the liberal revolution: small rural nobility, lower clerics, and many farmers that believed that liberalism would bring higher taxes. 
In addition to being regent, Espartero also served as prime minister of Spain three times. He was associated with Spanish liberalism that would ultimately use him as a symbol of victory over the Carlists.
Consequences.
The repression ordered by the Government was harsh. The militia was disarmed and several hundred people were arrested. Between seventeen and eighteen individuals from the Patuleyas (militia) and one of their commanders were shot. The city was collectively punished with the payment of an extraordinary sum of 12 million reals to compensate the dead or wounded soldiers and the city council had to pay for the reconstruction of the Citadel of Barcelona. The Government, at the urging of Espartero, also dissolved the Barcelona Weavers Association (the first union in the history of Spain) and closed all newspapers except the conservative "Diario de Barcelona".
A new revolt the following year, called the Jamància, led to another bombardment, this time focused on the shipyards and the walls causing 335 deaths and leading to 40,000 people fleeing the city. In July 1856, the city was again shelled from Montjuïc, following protests against the military coup of O'Donnell which had overthrown the progressive government.
References.
 ;templatestyles src="Reflist/styles.css" / ;