The earliest railways in the German states were often run by private entrepreneurs. Beginning in 1879, the Prussian government nationalized the major railways. After World War I, the German Reich took over control of the state railways of Prussia, Bavaria, Saxony, Württemberg, Baden, Mecklenburg-Schwerin, Hesse and Oldenburg. The individual railways were merged into the Deutsche Reichsbahn-Gesellschaft in February 1924. The DRG was the largest publicly owned company in the world when the Nazis privatised it in 1937. In the lead up to, and during, World War II the DR assimilated a great number of railway companies in the German-occupied territories as well as several smaller, previously privately owned lines in Germany.