The P class was a class of steam locomotives built to haul freight trains on the national rail network of New Zealand. The class consisted of ten individual locomotives ordered from the British company of Nasmyth, Wilson and Company in 1885, but miscommunications about the weight limitations imposed on the locomotives meant they did not start work until 1887. This debacle came at a time when the New Zealand Railways Department (NZR) was suffering from a lack of motive power to work on its rapidly expanding network and was part of what prompted a shift towards American and home-grown manufacturers. The classification of this class as "P" was the first example of the re-use of a classification that had previously been used for an earlier class. The members of the P class of 1876 had been sold to private companies or the Public Works Department, leaving the classification unused. The Railways Department chose to assign it to this class, setting a pattern that was followed with other classes in years to come, with the most prominent example being the A class of 1906 re-using the classification of the A class of 1873. Initially, seven of the P class locomotives were deployed in Otago, with the remaining three based in Auckland, and in 1899, the Auckland fleet expanded to four when one was transferred north from Otago. The locomotives started their lives with wooden cabs in a Gothic style, but they were later replaced with steel cabs. In service The P class locomotives were designed primarily for pulling freight trains. However, they were also capable of working passenger trains as required, and photographs exist of the engines occasionally pulling special excursion trains. Some changes were found necessary to obtain the best performance from them; the smokeboxes were extended, and the original Belpaire-type boilers were replaced with a new type to an NZR design. The passenger equivalent of the P class was the V class 2-6-2 tender locomotives, which were designed primarily for express passenger work. The locomotives had boilers of similar dimensions but were not interchangeable, as well as a shared design of tender. The later P class steel cab was also adapted for use on the V class. By 1926, all four Auckland members of the P class had been withdrawn from service, and the six southern members were retired within the next four years. Multiple members of the class