In the War of the Fifth Coalition, Emperor Napoleon I of France defeated Johann von Hiller at the Battle of Landshut on 21 April 1809 and Archduke Charles at the Battle of Eckmühl on 22 April. These defeats left Hiller's outnumbered force isolated on the south bank of the Danube. Hiller's retreat left Vienna exposed to French capture. Accordingly, Archduke Maximilian of Austria-Este was given the task of garrisoning Vienna with the 35,000 available troops. O'Reilly commanded 14 battalions of second-class Austrian and Bohemian landwehr plus 6,000 armed citizens. Other forces included a brigade of five elite grenadier battalions under Michael von Kienmayer; Joseph Dedovich's division of eight regular, six landwehr, and six volunteer battalions; and four battalions and five squadrons under Armand von Nordmann and Joseph, Baron von Mesko de Felsö-Kubiny. After a bombardment, the inexperienced Maximilian decided to abandon the capital and ordered O'Reilly to surrender with a token garrison. The archduke mismanaged the evacuation and O'Reilly capitulated on 13 May with 2,000 troops, including 13 generals, 17 staff officers, 163 officers. Even worse, the French recovered 100 pieces of artillery and a military chest with 4.5 million Gulden.