The D VIII was developed for local railways with steep gradients, where the conventional local railway locomotives no longer had sufficient power. The main focus was on the line to Berchtesgaden, which had gradients of up to 4 percent. The construction was carried out with three coupled axles, but these alone could not carry the weight due to the requirements. For this reason, a carrying axle was necessary, but initially the question arose as to whether this should be located in front of or behind the coupled axles.
Since the D VIII was primarily intended to drive slowly uphill and quickly downhill on the intended routes, the designer Richard von Helmholtz recommended a trailing axle to ensure smoother running. This was connected to the last coupled axle with the Krauss-Helmholtz bogey designed in such a way that the deflection of the trailing axle also shifted the coupled axle by a few millimeters in the opposite direction, making negotiation of curves easier.
From 1888, a total of 18 engines were built for Bavaria in several small orders, of which the last were delivered in 1903. Although series production had already ended ten years by then, the Augsburg Localbahn ordered three engines of the same design in 1913. It is particularly remarkable that they even ordered a fourth engines of the same type in 1937. At this point Krauss had already merged with Maffei and the design of the D VIII was almost 50 years old.
At the Reichsbahn, 17 of the 18 Bavarian locomotives were numbered in the class 986 and retired by the end of the 1930s. Only one locomotive survived until 1944 and another came to Austria in 1945, where it was used until 1959. At the Augsburger Localbahn, two of the locomotives were sold to a chemical company in 1956 and the other two were eventually retired the following year.
A variant of the D VIII was the D X, which was very similar to it but slightly lighter. It was built in 1890 and 1893 in two series of six and three and was in service until 1931 as class 9877. With a service weight of 42.7 tonnes, they achieved an indicated output of 220 kW and also a top speed of 45 km/h.