The steam engines of Class G 4/5 H operated by the Royal Bavarian State Railways were the most powerful of the German, 2-8-0, freight locomotives.
The locomotive works of Maffei in Munich based its design on principles developed in-house by Hammel and Leppla, which had already proved themselves well on the Bavarian S 3/6.
In fact there is a clear line of development for Maffei locomotives from the twin-cylinder Bavarian G 4/5 N through the C 4/5s built for the Swiss Gotthard railway and the Baden VIII e delivered to the Grand Duchy of Baden State Railways to the G 4/5 H.
Between 1915 and 1919 195 engines were built by Maffei and Krauss for the Royal Bavarian State Railways. Another 10 locomotives were ordered by the Imperial Railway Office (Reichseisenbahnamt) for MGD Brussels and 25 by the Head of Military Railways for war service and which were taken over by Bavaria after the First World War. 48 engines were transferred to France in 1919, as part of the ceasefire agreement, and 13 went to Belgium. The remaining 169 engines left in Germany were renumbered by the Deutsche Reichsbahn to 56 801–809, 56 901–1035 und 56 1101–1125.
Due to falling demand for transportation during the worldwide economic crisis, the electrification of lines in south Bavaria and the restationing of simpler, Prussian goods locomotives to Bavaria in great numbers the G 4/5 H was retired very quickly. This began as early as 1933 and was carried through so rapidly that by the beginning of the Second World War there were only 5 examples left. Two engines survived the war, but were retired and scrapped in 1947. The actual reasons for the premature retirement of this class can only be speculated upon today, but it may at least in part have been due to the opposition of the influential head of the construction department, Richard Paul Wagner, to "south German" four-cylinder, compound locomotives.
The G 4/5 Hs were coupled with tenders of Class bay 3 T 20.2 which, after the G 4/5 H's early retirement, were often attached to Prussian G 10 locomotives stationed in Bavaria because they were still relatively new and had a large capacity.
Hütter, Ingo (2015). Die Dampflokomotiven der Baureihen 54 bis 59 der DRG, DRB, DB, und DR (in German). Werl: DGEG Medien. pp. 305–310. ISBN978-3-937189-85-7.