The Bug was part of the frontier between the slices of Poland occupied by Austria and Russia after the Third Partition of Poland in 1795, the southern half of the eastern border of the Duchy of Warsaw (1809-1815), Congress Poland (1815-1867), of the Vistula Land (1867-1913), and of the Regency Kingdom of Poland (1917-1918). The Bug also formed part of the dividing line between German Wehrmacht and Soviet Red Army zones specified in a secret clause of the German–Soviet Frontier Treaty of 28 September 1939 following the September 1939 invasion of Poland in the Second World War.