The peasants were incensed because they hated the Viceroy Dalmau de Queralt, Count of Santa Coloma, they hated the Count Duke of Olivares and the viceregal administration. This hate grew, catalysed in part by the Catalan institutions and an important portion of the clergy.
But there's even more hate and anger. The Catalan nobility and the bourgeois hated the Viceroy, for not having defended their interest and obeying the government in Madrid instead, and of course, the Spanish governement too. The peasants hated being forced to lodge soldiers in their homes, so much so that they even killed a few of them. The clergy preached against the soldiers of the tercios, some of which they excommunicated - cutting them off from the Church, which was the worst thing that could happen to a Catholic.
In May, 1640, peasants from Girona the tercios (a military unit used by the Spanish army during the time of Hapsburg Spain) they had been hosting. By the end of the same month the peasants arrived in Barcelona, where the harvesters joined them in June.
The revolt found the city a its mercy. Officials and royal judges were murdered, so was the Viceroy Dalmau de Queralt, when he was found trying to escape by sea in a beach in Barcelona. These events took place during the Corpus Christi holiday, celebrated 60 days after Easter Day.
All this took Olivares and the high Spanish class officials by surprise. His armies where in fronts spread over Spain and they could not come to Catalonia. Thinking clearly for the first time the Count Duke tried caution for the first time and even to go back, but the situation was out of control. The hate for the tercios and the royal officials became generalized towards the the farmers and nobles who were close to the administration. Not even the Generalitat of Catalonia could control the rebels, who took the port of Tortosa.
Pau Claris, leading the Generalitat de Catalunya proclaimed the Catalan Republic. But the control of the oligarchy over the Catalan rebellion is effimerous. The Catalan rebellion turned into a revolt of impoverished peasants against the nobles and the wealthy, who were attacked as well. The oligarchy found itself surrounded by a real social revolution between the king Philip IV's authority and the radicalization of his poorest subjects.
But it's not only kings who change allies like a top model changes her hair colour. The Catalan governors joined king Philip IV's enemy, Louis XIII. Why? Because they were aware that there was no way to diminish the Catalan rebellion and that they were limited as to direct an independent state.
Cardinal Richelieu did not miss the chance to weaken the Spanish crown. With great difficulties Olivares began gathering an army to recapture Catalonia, not without great difficulties, while the Catalan deputation asks France to support them with arms.
In October, 1640, the French ships were allowed to use the Catalan ports and Catalonia agreed to pay the 3,000 men army that France would initially send to the municipality. In November, a 20,000 men Spanish army recovered the port of Tortosa for Philip IV and imprisoned several of their opponents.
On their way to Barcelona the soldiers abused the prisoners in such a way that it provoked the fury of the Catalans and urged them to resist even harder. When the army approached the city a revolt within the Catalan rebellion, even more intense than the Corpus de Sang broke out and Pau Claris saw no other choice but to form an alliance with France against Philip IV.
On January 16, 1641 it was announced that Catalonia was constituted as an independent republic, under the Protectorate of France. But only a week later the administration announced that Louis XIII would be the new Count of Barcelona. Thus Catalonia subjected itself willingly to the government of the King of France, Louis XIII as Louis I of Barcelona. On the 26th of the same month a Franco-Catalan army defended Barcelona and won. Philip IV's army retreated and did not return until 10 years later.
Catalonia found itself in the same situation it had been trying to avoid for o long, the battle field of a war between France and Spain. It had to fund an army and partially cede to a foreign power. King Louis XIII appointed a French viceroy and filled the Catalan adminstration with renowned pro-French.
The cost of the French army for Catalonia increased with each day and was proving to be each time more an occupation army. French traders began to compete with the locals and they were favoured by the French government, which pretty much turned the municipality in a new market for France.
But there were many things that contributed to the generalized state of unhappiness that tainted Catalonia: The war situation and its subsequent inflation, plagues and illnesses. The population realized that their situation was even worse with Louis XIII than it had been with Philip IV.
In 1643 Louis XIII's armies conquer Roussillon and other cities and a year later Philiip recuperates Monzón and Lleida, were king swore to respect Catalan laws. In 1648 the Peace of Westphalia and the retreat of its allies in the Netherlands, Frances began to lose interest in Catalonia. Philip IV, aware of the discontent of the Catalan population over the French occupation, thought it was about time to attack, and in 1651 an army commanded by John of Austria the Younger began a siege of Barcelona. The Franco-Catalan army surrendered in 1652 and recognizes Philip IV as sovereign and John of Austria the Younger as viceroy of Catalonia, although France kept control of Roussillon.
The Treaty of the Pyrenees was signed in Phaesant Islands in 1659, putting an end to the war between Spain and France which had begun with the 30 Years War.
All this internal instability damaged Spain, the Spanish learnt quite a lesson in Barcelona. However, Catalonia so much more. France took the opportunity to exploit a situation that gave it much benefits at almost no cost.
If you want to know what happened before, go to Part I.