The Battle of Andoain (Basque: Andoaingo Gudua) was a military engagement of the First Carlist War that was fought on 14 September 1837. It took place around the Basque village of Andoain, south of the main Liberal stronghold of San Sebastián. Liberal troops under Leopoldo O'Donnell had captured Andoain on 9 September, driving the Carlist garrison there to the western bank of the Oria. Over the next three days, both sides constructed breastworks amidst intermittent skirmishes. After two days of trench warfare, Carlist troops poured heavy artillery fire on the Liberal lines and launched an all-out offensive, supported by reinforcements brought in from Navarre by José Ignacio de Uranga. 
The Liberals were flanked on their left wing, and their lines crumbled. Only two British Auxiliary Legion regiments and a number of their Basque guides, the Chapelgorris, were left to resist the Carlist advance, but were eventually overrun and captured. Most of the Legion's soldiers who surrendered to the Carlists were summarily executed due to popular anger over the Legion's burning of local buildings in the previous weeks. The battle led to the end of the British Auxiliary Legion as an effective fighting force, with two-thirds of their members killed, wounded or executed by the Carlists or local civilians. O'Donnell and the remnants of his forces withdrew to Hernani, Gipuzkoa.
Background.
After the battle of Oriamendi in March 1837, with the morale of the Carlist army on the rise, royal pretender Carlos María Isidro de Borbón conceived a thrust of his army through Aragon, Catalonia and Valencia to take supplies and reinforcements from their allies in the region, and later carry out an all-out offensive on Madrid. The main reason behind the operation was to lift the Liberal blockade of the Basque provinces, which was taking effect on the economy of these Carlist-held areas. The plan is referred to by historians as the "Royal Expedition". The British Auxiliary Legion, which had been defeated at Oriamendi and was based at San Sebastián, took advantage of the circumstances to lead a Liberal offensive along the Cantabrian coast, only defended by isolated garrisons. The Liberals only found some resistance at Irun, which was taken by assault and plundered on 17 May. When the Carlist troops were approaching Madrid, Spanish Liberal General O'Donnell left the besieged San Sebastián to launch a successful offensive to the south, on Hernani and Urnieta. The Carlists retreated to the other side of the rivers Oria and Leitzaran, near Andoain.
Buildup.
On 8 September 1837, O'Donnell massed a 7,000-men strong force to advance on the Carlist lines between the villages of Hernani and Urnieta. The Liberals pushed their enemies towards the natural barrier formed by the rivers Oria and Leizaran, where the two armies stood facing each other at a distance of a mere 200 yards. O´Donnell established his headquarters at Andoain, which lays on the main road between San Sebastián and the Carlist stronghold of Tolosa. The Carlist forces, composed of five Guipuzcoan battalions and an improvised militia of local residents, controlled the western bank of the river Oria. The opposing forces started to fortified their positions and entrenchments, O´Donnell men by rebuilding the town's fortress, destroyed by the retreating rebels, and the Carlist faction by setting up a six-feet high barricade with a number of embrasures that enabled them to keep the town under fire. The wall had the shape of a horseshoe, following the course of the stream, with the convex side aimed to Andoain. The extreme left ended up in a bunker, where the Carlists mounted a permanent watch. The narrowness of the stream and the main bridge made any force attempting to cross the river an easy target for the rebels. The accurate fire from the parapets indeed hampered the Liberals building of their own breastworks. The Carlist bunker was connected with their rearguard by a ravine which edges were protected by rocky crags, while the gaps were closed with casket filled with clay and stones. This means that any reinforcement or movement out or into the bunker and eventually to the barricade became unnoticed to the Liberals. On the right side of the trenches, the terrain allowed O'Donnell to command the enemies' positions, which were occasionally checked by an artillery battery of British Auxiliary Legion, which inflicted a number of casualties among the Carlists when their rounds struck home. The battery consisted of two nine-pounder guns and one twelve-pound howitzer. In the course of these skirmishes, two Legion officers were wounded by snipers. The Spanish Liberal troops were stationed to the left and to the right of the fortifications, while two companies of the Legion's Rifle Brigade were deployed in several outposts along the river. In order to deprive Carlist forces of supplies, the British Auxiliary Legion burnt numerous local barns (whose owners were suspected of being Carlist sympathizers), totalling 126 in all. These actions enraged the local residents, who sought revenge by moving "en masse" to the Carlist zone and joining their ranks. A British regular force of Royal Marines and Royal Artillery deployed in Hernani, but did not intervene in the following actions.
The battle.
During the buildup process, Navarrese troops led by General José Ignacio de Uranga, departing from Arróniz in Navarre, sneaked through the valley between Tolosa and Andoain. These reinforcements increased the strength of the rebel army to some 3,000 soldiers. In the morning of 14 September, the loyalists found that two artillery emplacement had been mounted on the palisade. Five rebel cannons began to pour heavy fire on the Liberal forces at Andoain itself. The British battery returned fire, and claimed to have silenced one of the pieces. The exchange lasted until 11 o'clock, when the rebel infantry emerged from their entrenchments, and supported by intense musketry fire, advanced on the left and right flanks of the Liberal army. Uranga's plan was to lure the main body of the Liberal army to their right, north of Andoain, and then launch a two-pronged attack on the weakened center and left. The Rifle Brigade, along with two Scottish units of the British Auxiliary Legion, the 5th Scotch and 6th Scotch Grenadiers, were in the center, watching the main bridge on the river Oria, along with their Basque guides, known as the Chapelgorris. The Chapelgorris were forced to abandon their posts at the bridge after fierce fighting, as the right wing of the Carlist attack made gains on the eastern bank of the river.
According to British sources, it was at this stage of the battle that Colonel F. R. Clarke, in charge of a Scottish unit, mustered a column of nearly 300 troops in the town's main square and launched a bayonet attack in the direction of the bridge, which eventually drove the Carlists back to the river's edge. Earlier in the battle, however, O'Donnell had moved the "Gerona" battalion, made up of veteran Spaniard soldiers who had kept at bay the Carlist forces on the left flank over the past days, to meet what he perceived as the main Carlist effort on his right, replacing them with the inexperienced troops of the "Infanta Isabel" battalion. These young recruits fled in panic when rebel forces reached the eastern bank of the river Oria. Their retreat allowed the Carlist army to flank the British from their left. The artillery wagon of the Legion, whose cannons had been emplaced on the right side of the fortifications, was forced to withdraw, defended by the British Lancers and returning fire whenever possible. Two British gunners were killed by counter-battery fire. At this point, Colonel Clarke's troops became trapped between the bridge and downtown Andoain, now occupied by the Carlists.
Clarke was last seen at the head of the bridge, where he received a sabre wound from a Carlist officer on one of his legs and fell from his horse. Clarke, with his left arm still in a sling from a wound received at Oriamendi, became a prisoner and was executed the following day at Tolosa. One of Clarke's subordinates, Captain Larkham, was shot and killed by a sharpshooter while involved in a sword duel with a Carlist officer. After the action on the bridge, the Scottish units along with two companies from the Rifle Brigade were cut off from the village's center. One of the Rifle Brigade's companies, keeping watch on the Carlist main breastwork and commanded by Captain Courtenay and two subalterns, was almost wiped out by Carlist troops, with only five survivors. The stragglers fled in disarray, only to be killed by the rebels or die from exhaustion. The remains of Clarke's column, meanwhile, sought shelter in the local church. The thick walls of the building provided a good protection against gunfire, and in its stores had plenty of food and supplies, but the 25 soldiers eventually surrendered to the Carlists on 16 September, on the promise of mercy.
During the withdrawal from Andoain, Spanish General O'Donnell had a narrow escape when his horse was killed by a Carlist bullet. Overpowered by the tumultuous retreat of his troops, O´Donnell fell into a ditch. He was rescued by Colonel James Arbuthnot, a Scottish army officer who had been in the Spanish service for 35 years. It was at this stage of the battle that a company of Lancers carried out a rearguard action, in an attempt to relieve the Scottish units and Rifle Brigade troops surrounded in the village and recover a cart of rockets overturned in the retreat. The cavalry charge into Andoain was eventually beaten off by the Carlists. The action resulted in the death of the company commander and aide-de-camp of Brigadier O'Connell, Mayor McKellar, and two ranks. A total of 13 British officers lost their lives at Andoain, some of them executed or lynched after surrender. The action lasted barely half-an-hour.
Overstretched by their own progress, the Carlists were forced to leave Urnieta, which was briefly retaken by the Lancers and other loyalist troops. The position, however, was deemed untenable by O'Donnell, who ordered his men to fall back to Hernani at dusk. The victorious Carlist troops rounded up 100,000 rounds of ball cartridges, 1,500 firearms, 199 rockets, 150 tents, 3,000 pairs of shoes and three-days provisions for 10,000 men.
Massacre of British prisoners.
Although the Lord Eliot Convention put an end, or at least restrained the indiscriminate execution of prisoners, the Carlists usually did not apply the agreement to foreign combatants, particularly after Carlos of Bourbon promulgated the "Durango decree" which stated that all foreign "adventurers" fighting with Liberal forces should be summarily executed. Most of the Legion's troops who surrendered during the battle were summarily executed by Carlist troops or lynched by local residents angered by the destruction of their property over the previous days. The burning of civilian residences and farms had been already denounced at the Carlist Deputation at War on the session of 10 September. 
Crowds of Basque people cried out in Euskara "ez da cuartelic suematen duenentzat!" ("no quarter to the arsonists"). Spanish sources put the number of executions there at 60. All British Auxiliary Legion members captured at Andoain were forced to march to the rebel headquarters of Tolosa, where they were likewise massacred on the main square. British sources from Pamplona reported instead that the prisoners of war from the Legion who were captured in Andoain were killed "in situ", with an exception made for 37 soldiers, 20 of whom were stabbed to death on the road to Tolosa and the remainding 17 executed by firing squad in the Carlist stronghold.
Aftermath.
After the battle, the British Auxiliary Legion ceased to exist as a useful fighting force, with a total of 500 casualties, which represents two-thirds of the Legion strength. Some authors claim the execution of some 150 officers and ranks after the battle. Alexander Somerville lists 136 deaths, 131 of them from the Scottish units and the Rifle Brigade, without distinguish between killed in action and executed. Legion surgeon Henry Wilkinson and the British press of the time differ slightly from Sommerville, with 13 officers and 143 ratings either killed in action or massacred. Others sources referred to up to 25 officers killed. The heavy casualties, together with the chronic lack of payments and supplies owed by the Spanish government and the indifference of Crown officials in London, led to the official disbandment of the British Auxiliary Legion on 10 December 1837.
The Liberal