The storm of Mataro of 17 June 1808 was a minor French victory that came just before General Duhesme’s first attempt to capture Gerona in June 1808. The French had captured Barcelona on 29 February 1808, but they had not bothered to seize the city of Gerona, on the main road between Barcelona and Perpignan. At first this had not seemed important, but the start of the Spanish uprising in the spring of 1808 left Duhesme dangerously isolated from the main French armies around Madrid, and so in June he decided to attack Gerona to secure his direct line of communication with France. In mid-June he left Barcalona at the head of a column 5,900 strong, containing half of his available infantry and most of his cavalry.
His advance along the coast road was resisted by the local levies, known as the somatenes. The first clash came at Mongat, early on 17 June. There Duhesme ran into a force of around 8,000 somatenes, but a quick outflanking move forced them to disperse after a short skirmish. In the afternoon of the same day the French reached the un-walled town of Mataro. To make up for the lack of any walls, the citizens had built blockades across the main streets, and had managed to gather two or three cannon. Duhesme sent his Italian brigade, under General Milosewitz, to attack the town, and they soon overwhelmed the makeshift defences. Duhesme then gave his troops permission to plunder the town for one day, which was then considered to be perfectly acceptable after the capture of a defended town. The next day, after his troops had sacked the town, Duhesme moved on, reaching Gerona on 20 June.