Locomotives of New Zealand is a complete list of all locomotive classes that operate or have operated in New Zealand's railway network. It does not include locomotives used on bush tramways. All New Zealand's main-line locomotives run on a narrow gauge of 3 ft 6 in (1,067 mm). Early locomotives The first locomotive in New Zealand was built by Slaughter & Co in Bristol, arrived at Ferrymead in May 1863 to work on Canterbury Provincial Railways' 5 ft 3 in gauge. It was withdrawn in 1876. The Ferrymead to Christchurch railway line was not completed until 1 December 1863, so the steam locomotive Lady Barkly, in use on Invercargill's jetty in August 1863 during construction of the Bluff branch, may have been the first locomotive in steam. The first steam engines built in New Zealand were produced in 1872. Fraser and Tinne built an 0-4-0 in Auckland in 1872, but it was based on a Hornsby traction engine. Similarly, a steam crane was converted during construction of the Port Chalmers railway, though it could only haul about 10 tons. The first locomotive entirely built in the country was a engine for the Foxton Tramway contractor, Ashworth Crawshaw, by R. S. Sparrow & Co in Dunedin, also in 1872. It was named Palmerston. Horses had replaced Palmerston by 1874, but, in 1875, after iron had replaced wooden rails, the same branch had an A class steam locomotive built in Wellington by E.W. Mills' Lion Foundry. Classification details Steam locomotives were originally categorised with just a single letter, such as the "F class". When a new class was built as an enhancement of an old class, the old class's letter was re-used, followed by a superscript upper-case letter. For example, the 1906 A class was followed by the AA and AB classes. Diesel-electric and electric locomotive classifications originally consisted of an upper-case D or E respectively followed by a second and sometimes a third (sub-class) letter. The second and third letters are sometimes represented as smaller-sized upper case (for example, as seen on many locomotive cab-side number plates). New classes were not always given the classification that alphabetically followed that of the previous class that had most recently been acquired. For example, the DJ class was followed by the DX class followed by the DF class. If an entire class had been withdrawn from service and the classification no longer in use,