Battle of Jena–Auerstedt
Prussia had acquired the City of Danzig in the course of the Second Partition of Poland in 1793. After the defeat of King Frederick William III of Prussia at the 1806 Battle of Jena–Auerstedt, according to the Franco-Prussian Treaty of Tilsit of 9 July 1807, the territory of the free state was carved out from lands that made up part of the West Prussia province.