Although the area had been liberated by a popular uprising in 1806, the Duchy of Warsaw was officially created in 1807 by Napolean Bonaparte as part of the terms of the Treaty of Tilsit following his military victories over the Kingdom of Prussia. The fortunes of the Duchy of Warsaw were directly tied to the continued success of Napolean. In 1809, the Duchy of Warsaw gained a substantial amount of territory as a result of Napolean's victories over Austria and the terms of the Treaty of Schonnbrunn.
In 1812, Poles began to dream of the restoration of a Polish-Lithuanian Commonwealth as Napolean's armies began marching into Russia. For various reasons, not much of Napolean's armies ever marched back. By 1813, most of the Duchy of Warsaw was re-occupied by Prussian and Russian troops. By the terms of the Congress of Vienna, the Prussian and Russian partitions of Poland were restored. The bulk of territory of the Duchy of Warsaw fell into Russian hands and became the semi-autonomous "Congress Kingdom". It was, in reality, a puppet state and was annexed into the Russian Empire in 1831.