The army was formed at the time of the creation of the Duchy of Warsaw in 1807. The army participated in numerous wars on the side of Napoleonic France, including in the War of the Fourth Coalition (1806–1807), Peninsular War, the War of the Fifth Coalition (primarily in the Polish–Austrian War) of 1809, and in the War of the Sixth Coalition (in particular, in the French invasion of Russia) of 1812–1813. In the Russian campaign of 1812, the Polish units formed an entire corps (the V Corps) of the Grande Armée. The army sustained over 70% losses. The Army suffered further heavy casualties in the battle of Leipzig in 1813, where Prince Poniatowski died. After Napoleonic defeats in 1813, the Duchy was occupied by Napoleon's enemies. As several garrisons in fortresses held out, much of the Army followed Napoleon back to France that year. Disorganized after Poniatowski's death, in 1814, the army still had about 8,000 people in French-controlled territories, mostly in France, but was incorporated into the French Army, and ceased to exist after the final defeat of Napoleon. After the Treaty of Fontainebleau most of the Polish soldiers were given into the custody of the Russians.