The Austro-Polish War was fought between the Austrian Empire against the Duchy of Warsaw, a client state of the First French Empire, in 1809 during the War of the Fifth Coalition. Austria's defeat resulted in the Polish annexation of Lwow, Stanislawow, ad Zamosc.
Emperor Napoleon I of France established the Duchy of Warsaw in 1807 in Polish territories ceded to France by Prussia under the 1807 Treaties of Tilsit. In 1808, the Army of the Duchy of Warsaw was weakened as the French corps guarding it were sent to Spain at the start of the Peninsular War, and only the duchy's own Polish forces remained in it. With the start of the War of the Fifth Coalition in 1809, Archduke Ferdinand Karl Joseph of Austria-Este and a 38,000-strong Austrian army invaded the Duchy of Warsaw. The Polish general Jozef Poniatowski fought the Austrians to a standstill at the Battle of Raszyn on 19 April before retreating, allowing the Austrians to occupy Warsaw. Poniatowski kept his army mobile in the field and crossed to the eastern bank of the Vistula. Ferdinand garrisoned Warsaw with 10,000 soldiers and split his remaining forces, sending 6,000 troops to the right bank of the Vistula and the rest towards Torun. At Radzymin, Grochow, and Ostrowek, the Poles defeated elements of the Austrian army and forced them to retreat to the western side of the river. The Poles also defeated an Austrian siege of Praga, and Poniatowski prevented Ferdinand from establishing a bridgehead on the other side of the Vistula. The Poles liberated Lublin on 14 May, Sandomierz on 18 May, Zamosc on 20 May, and Lwow on 27 May, and Polish administrations and military formations were quickly organized in the taken territories. The main Austrian army, whose supply lines were cut by Poniatowski, was ultimately forced to abandon the siege of Torun, withdraw from Warsaw on 1 June, and move south to engage the Poles in Eastern Galicia. Poniatowski ignored this army and took as much of Galicia as possible. On 3 June, the Imperial Russian Army invaded Galicia in support of the French and hoping to prevent the Poles from gaining too much strength. The Austrians recaptured Sandomierz on 18 June and then Lwow, but Poniatowski liberated Kielce and Krakow. The Austrian defeat at the Battle of Wagram in July led to the end of the War of the Fifth Coalition and, in October 1809, Austria's war with Poland. While some of the territory liberated by Polish forces was returned to Austria under the Treaty of Schonburnn, Western Galicia was incorporated into the Duchy of Warsaw.