On 2 July 1938 the electrified rail line between central Wellington and the northern suburb of Johnsonville was officially opened by Minister of Railways Dan Sullivan and Wellington Mayor Thomas Hislop. This steep, winding line had been built by the Wellington and Manawatu Railway Company in 1886 and until 1937 was part of the main trunk route out of the capital. Following the completion of the Tawa Flat deviation that year, the bypassed Johnsonville section was converted into a suburban route. The line was served by English Electric DM-class multiple units, the first of their kind in New Zealand.
This was the country’s third electric railway: the Ōtira tunnel on the Christchurch to Greymouth line was electrified from 1923 to 1997, and the Christchurch–Lyttelton line from 1929 to 1970. (Electric propulsion was seen as ideal for use in tunnels, to avoid the smoke nuisance caused by steam locomotives.)
By 1940 the North Island main trunk line out of Wellington had been electrified as far north as Paekākāriki (electrification was extended to Paraparaumu in the 1980s and to Waikanae in 2011). The increasingly busy Hutt Valley suburban lines were electrified in the 1950s and also served by DM multiple units. These were replaced by Hungarian-built EM-class units in the 1980s, but a number of DMs were refurbished for continued use on the Johnsonville line. The remaining DMs, some of which had been in service since 1949, were replaced in 2012 by new Matangi units.