In May 1837, while the bulk of the Carlist army was absent on the Royal Expedition, the troops of the Liberal garrison of San Sebastián led by Lacy Evans, Commander of the British Auxiliary Legion, launched an offensive to take the corridor joining the city with the French border. They had just received reinforcements from troops in Portugalete and close to 20,000 men left San Sebastián to take Lezo, Rentería, Astigarraga and Hernani on the 14th and 15th of May.
Espartero set up base in Hernani to protect Evans' troops, which were heading to Oiartzun and the mouth of the river Bidasoa. The Carlists abandoned Oiartzun when they saw Jáuregui's division advancing, but decided to stand firm in Irun.
This garrison was defended at the fort of "El Parque" and the Town Hall, which had been fortified for the occasion. Just 500 Carlists, made up of troops and volunteers, faced Evans' 12,000 men, 5,000 of whom were British and recently humiliated in the Battle of Oriamendi. In the afternoon of the 16th, the British artillery began bombarding, but only managed to take the houses outside the city walls.
The offensive began again at daybreak on the 17th and lasted all day because of the strong Carlist defence. The Liberal cannons were not powerful enough so they were forced to attack with the infantry and take the city almost house by house, suffering many casualties in the act. The Town Hall and fort finally surrendered that same afternoon.
The long, drawn-out battle and numerous casualties gave rise to the sacking of the town, mainly by the British troops. Hondarribia surrendered the day after without resistance. The Guipuzcoan border was now controlled by the Liberals.