During the First World War, it was quickly noticed through the interaction of the railway administrations with their different locomotives that this diversity represented a very big obstacle in maintenance and operation. Thus, a new locomotive was developed, which was to be procured as a heavy freight locomotive by almost all German railway administrations. Since Prussia had by far the largest vehicle fleet in Germany and the G121 was already a very modern and powerful freight locomotive, it was further developed. Their weight and thus also the axle load were reduced somewhat in order to be able to use them on a larger part of the route network.
During development, the weaknesses of the G 121 were also taken into account, the most serious of which was the excessively long firebox. A Belpaire firebox with a wider grate that was easier to load was now used. In addition, all three cylinders were allowed to act on the third coupled axle, which could probably have had reasons in production and in the realization of the mass balance.
Prussia again ordered the largest part with 1,168 units, but orders for a total of 311 engines also came from almost all other major German railways. The first units only came to Bavaria after the founding of the Reichsbahn and only Oldenburg and Mecklenburg didn't use G 12s, since lighter locomotives were sufficient there due to the simpler topographical conditions. As a rule, the non-Prussian railway administrations also used the designation G 12, only in Saxony they were also called XIII H in the tradition of their own variant of the G 121.
These engines, which came from many different manufacturers, occupied the number ranges of class 582-5 and 5810-21 at the Reichsbahn, where the most recently completed engines already ex works were marked with these numbers. To save fuel costs, six locomotives were converted to pulverized coal firing as early as 1930, but larger numbers only followed after the end of the Second World War.
In addition to some locomotives which remained abroad after the war, both newly founded German railway administrations together received over 1,000 units, which were indispensable in the GDR in particular. While the last ones were phased out by the Bundesbahn in 1953, the Reichsbahn still had over 300 units in 1968 and only put the last ones out of service in 1976. Of particular note are the Rekoloks of the 5830 series, which will be presented in a separate article. Although there was only a very moderate increase in power, the reconstructed engines had a large number of modern features and looked very similar to the standard locomotives.