The Victorian Railways M class were 4-4-0T (tank) steam locomotives for suburban passenger service in Melbourne, a pattern engine being supplied in 1879 by Beyer, Peacock & Company. Twenty-one further locomotives of this model were built by the Phoenix Foundry of Ballarat, in three batches, from 1884 to 1886. They were numbered 40 (pattern engine), 210-240 (even numbers only), and 312-320 (evens only), and were classed M in 1886.
Because their relatively small coal bunker proved inadequate for the rapidly expanding suburban network of the 1880s, they were rebuilt between 1901 and 1905 at the Newport Workshops as 4-4-2T locomotives. They were given an enlarged bunker of capacity on extended frames supported by a trailing radial axle, and the cylinder diameter was increased from . At the same time, the opportunity was taken to replace the troublesome leading Bissell truck with one of the design being used successfully on the contemporary A class and D class locomotives. The rebuilt locomotives were regarded as equivalent to the Victorian Railways' ubiquitous E class 2-4-2T suburban engines for rostering purposes, and were known as the M<sup>E</sup> class, although the original 'M' class plates carried on the locomotives were not altered.
The re-built engines proved very successful in service, and withdrawals did not commence until 1913, following the introduction of the larger D<sup>DE</sup> (later D<sup>4</sup>) class suburban tank engines from 1908. The last M<sup>E</sup> locomotives were scrapped in 1922, having been rendered surplus by the conversion of suburban lines to electric traction from 1919 onwards. None have been preserved.