The Grand Duchy of Baden was an independent state in what is now southwestern Germany until the creation of the German Empire in 1871. It had its own state-owned railway company, the Grand Duchy of Baden State Railways (Großherzoglich Badische Staatseisenbahnen or G.Bad.St.E.), which was founded in 1840. At the time when it was integrated into the Deutsche Reichsbahn in 1920, its network had an overall length of about 2,000 kilometres (1,200 mi).