The NZR B class of 1874 was the first of two steam locomotive classes to be designated as B by the Railways Department that then oversaw New Zealand's national rail network (the second B class was introduced in 1899). Ordered from the Avonside Engine Company in 1874, the locomotives were of the Double Fairlie type and were the first British-built locomotives to feature Walschaerts valve gear. They were not the first Double Fairlies to operate in New Zealand, as the first two members of the E class had commenced operations in 1872.