These attempts ultimately failed, after French forces occupied Vienna in May 1809. The Austrians under Archduke Charles were able to repulse them at the Battle of Aspern on 21-22 May; however, Napoleon withdrew his forces and crushed Charles' army at Wagram a few weeks later. The archduke had to sign the Armistice of Znaim on 12 July. In October, Austrian Foreign Minister Johann Philipp Stadion was superseded by Klemens von Metternich.