On 22 July 1812, Wellesley won a tactical victory over Auguste Marmont at Salamanca. The Spanish, British and Portuguese then entered Madrid on 6 August and advanced towards Burgos. Realising that his army was in danger of being cut off, Soult ordered a retreat from Cádiz set for 24 August. After an overnight artillery barrage, the French intentionally burst most of their 600 guns by overcharging and detonating them. The Coalition forces captured many guns, 30 gunboats and a large quantity of stores.