In September 1837, when the bulk of the Carlist troops of the Royal Expedition were approaching Madrid, the Liberal General O'Donell left San Sebastián to launch a successful offensive on Hernani and Urnieta. The Carlists retreated to the other side of the river Oria, near Andoain. While they headed to these positions, the Liberal troops they set fire to more than 120 houses. Most of these fires have been attributed to troops of the British Auxiliary Legion.
Between the 9th and 13th of the month, the two armies observed each other, with the Liberals in the centre of Andoain and the Carlists on the other side of the river, and occasionally exchanged fire Uranga, Commander of the Carlist troops in the North, arrived with reinforcements from Navarre and decided to attack the positions of O'Donell on the 14th despite the latter's numerical disadvantage. The Liberals were eventually overwhelmed in the gruelling combat and scattered off in the direction of San Sebastián.
There was a terrible slaughter, mainly among British troops, since many of the farmers who had lost their homes had blended in with the Carlist troops to seek their revenge by killing the prisoners. Over 620 Liberals were found dead after their retreat. O'Donell himself only just managed to escape and seek refuge in San.