Since the three Class G Garratts procured in 1928 could not convince due to various problems, a new, powerful locomotive for heavy passenger and freight trains was needed for the mountainous North Island Main Trunk Railway. In order to be able to avoid further problems with articulated locomotives, a heavy locomotive with a 4-8-2 wheel arrangement was initially planned. A major problem with the limited loading gauge of the Cape gauge lines was getting the most powerful locomotive possible to operate under these conditions. The locomotives were designated class K after the previous class of the same designation, supplied from the USA in 1877, was phased out towards the end of the 1920's.
The design that was finally implemented had a boiler of the maximum practicable diameter. The trailing axle was replaced with a bogie so that a large firebox could also be carried. In order to be able to arrange the largest possible cylinders within the loading gauge, they were designed with a diameter of just 20 inches and a long stroke of 26 inches. The Heusinger valve gear initially caused problems due to the excessively long piston travel, but these could be remedied by reducing the travel from eight to 7.25 inches.
The total number of 30 locomotives mainly replaced the 4-8-2 Class X locomotives. They performed very well with heavy trains and were mostly converted to oil firing after the Second World War due to the lack of coal. The changes made were carried out in parallel with their successors of the KA class. Since there were frequent frame fractures in the area of the firebox in the K class, new frames of the same design as in the KA were installed.
Although the switch to diesel traction took place in the mid-fifties, several examples of the class were still being overhauled at that time. All locomotives were finally decommissioned between 1964 and 1967. A total of three examples were preserved, two of which were last used as stationary steam generators. One of these two locomotives, as well as one that was recently exhibited in a museum, were selected for a renewed refurbishment in 2013 and 2014 respectively.