The first battle of Castalla (21 July 1812) was a French victory over the Spanish Army of Murcia, largely caused by the over-complex Spanish plan.
In the autumn of 1811 the French invaded Valencia. General Blake, the commander of the Spanish Army of Valencia, attempted to stop them, but ended up besieged in Valencia (25 December 1811-9 January 1812), and was forced to surrender to Suchet. This was the last significant French success in Spain. The Spanish held on to Alicante, some fifty miles further south, where General Jospeh O'Donnell commanded an army built around the remnants of Blake's original force. He was watched by 5,000 men under General Harispe, who was posted around Castalla, fifteen miles to the north of Alicante.
Harispe's troops were spread out. Two battalions of the 7th Line and most of his cavalry were at Castalla. Three battalions of the 1st Leger and part of the 44th Line were at Ibi (about four miles to the east/ north east). Two battalions of the 116th Line were in reserve at Alcoy, another five miles to the north-east of Alcoi.
O'Donnell had 10,000 infantry and 1,000 cavalry under his direct command, and another force under Bassecourt further to the north. He planned to attack the troops at Castalla and Ibi before the rest of Harispe's army could intervene. He split his force in three. He commanded the central column, with three infantry brigades, two squadrons of cavalry and a gun battery. This force was to move up the road to Castalla. The right-hand column, made up of Roche's division, was to advance on the right, and attack Ibi. The left-hand column was made up of 800 cavalry under General Santesteban, with orders to carry out a wide outflanking movement and try to attack Castalla from the rear.
The Spanish marched through the night of 20-21 July, and emerged in front of the French positions at about 4am on 21 April. O'Donnell's plan meant that his army was split into three entirely unconnected sections, of which only his own column would become heavily engaged.
When O'Donnell appeared in front of Castalla, General Delort, the French commander there, abandoned the village and pulled back to a strong position behind a ravine crossed by a single bridge. He also summoned help from General Mesclop at Ibi, but this didn't arrive until the battle was won. Delort only had one squadron of cuirassiers with him when the Spanish appeared, but was expected to be reinforced by the 24th Dragoons and two squadrons of the 13th Cuirassiers.
The Spanish attack developed quite slowly. Miehelena's and Mijares's brigades found a way across the ravine upstream of the French, while Montijo, supported by two guns, attacked towards the bridge. However before the Spanish could get very far the French reinforcements began to arrive. The first to appear were the 24th Dragoons, who surprised Mijares and drove into his flank, breaking up his battalions. The 24th Dragoons then moved to the bridge, and charged across. The two Spanish guns were over run, and Montijo's brigade was also broken up. Delort then attacked with his infantry, defeating Montijo's brigade. At least half of the 6,000 Spanish infantry that began the battle were captured by the French. Meselop arrived with his reinforcements after this part of the battle had been won, and was sent straight back to Ibi.
On the Spanish right General Roche had never really got into the fight. He found a single company from the 44th Foot in the castle at Ibi, supported by the rest of the 44th and a troop of cuirassiers. Roche forced the French out of the village, but quickly retreated after French troops appeared from his left (Meselop returning from the main battle) and right (Harispe coming from Alcoy). The French were unable to interfere with the retreat, and Roche managed to return to Alicante with his division intact. The cavalry on the Spanish left also managed to escape intact, having been given too far to travel to arrive in time to take part in the main battle.
Roche's escape meant that the French weren't able to risk an attack on Alicante. Shortly after the battle a British expeditionary force under General Maitland, coming from Sicily, arrived at Alicante, having ignored Wellington's instructions to land further north along the coast. These reinforcements meant that Alicante was secured, but the Spanish losses at Castalla meant that Maitland wasn't able to do anything significant.