On 14 June 1809, during the War of the Fifth Coalition, this was the site of the Battle of Győr (Battle of Raab), where the army of Eugène de Beauharnais defeated the Hungarian "noble insurrection" (militia) and an Austrian corps under the Archdukes Joseph and Johann. Napoleon's forces occupied the castle and had some of its walls blown up. The leaders of the town soon realized that the old ramparts were not useful any more. Most of the ramparts were destroyed, allowing the town to expand.