The M5 is a series of 16 four-axle diesel-electric locomotives built in 1979 by Hitachi for the Sri Lanka Railways. They were originally powered by an MTU V12 built by Ikegai in Japan with 1,640 hp. Due to technical problems, they only had a short service life in their original form. While some were withdrawn, a total of 13 were rebuilt.
The first one was No. 769 that received an MTU 396 in 1991 and became class M5A. This engine was left over as a spare for an S8 DMU and only had 1,150 hp. Four were rebuilt to M5B starting in 1997 with a 1,500 hp Paxman Valenta. From 2001, eight became M5C by replacing the engine with a Caterpillar 3516 DITA delivering 1,570 hp.