The siege of the Retiro (13-14 August 1812) was the only French attempt to defend Madrid in the aftermath of the battle of Salamanca, and saw the British storm the outer line of defences before the defenders surrendered.
Napoleon had ordered the construction of a fortified area on the Retiro heights, to the east of the city, and it now contained a significant portion of the booty seized by the French during their years in Spain, including many captured guns, arms and other munitions. It was protected by two lines of defences, and a star fort. King Joseph decided to leave Lafon Blaniac, the governor of La Mancha, to defend the place, giving him 2,000 men heading for Soult's Army of Andalusia. Joseph hoped that Soult was on his way towards Madrid, and that the Retiro might be able to hold out until he restored French control of the city.
The defences of the Retiro weren't terribly strong. The outer line mainly consisted of the existing wall of the Retiro Park with loopholes cut into it and some supporting positions. The Retrio Palace and the Museum were the strongest part of this line. The inner defences were stronger, with ten bastions, but was still more of a field work than a proper fortification. The star fort, which was built around the old royal porcelain factory, was the strongest part of the entire works. However there was very little water in the place, and the inner area had been filled with flammable material, which would probably have been ignited in any bombardment.
Wellington entered Madrid on 12 August. On the following day he examined the Retiro, and then ordered an attack on the outer lines for that evening. 300 men from the 3rd Division were to attack from the north, 300 from the 7th Division at the south-west. The French hardly put up any resistance, and only inflicted 10 casualties before retreating into the inner llines.
Lafon-Blaniac was now dangerously short of water, and aware that his fortress was likely to explode if anyone fired on it. Early on 14 August he sent out a messenger under a flag of truce, officially to threaten to fire on the city if he was attacked, but actually to ask for terms. Wellington offered reasonable terms - they would surrender with the full honours of war, the officers could keep their swords, horses and baggage, the men their knapsacks. Lafon-Blanica accepted those terms, and his men marched out at 4pm on 14 August. At least for the moment the last French presence in Madrid had gone.