In 1807, after Napoleon Bonaparte established the Duchy of Warsaw, Józef Poniatowski was appointed the minister of war. He commanded a 16,000-strong army during the Austro-Polish War (April to October 1809) and achieved tactical success over a larger and more experienced Austrian force in the Battle of Raszyn. There followed a Polish advance into the territory of Galicia. The conflict ended with a Polish victory, which allowed the Duchy to recover some of the lands lost in the Partitions of Poland.