The B12 class were built by a number of manufacturers for the Queensland Railways between 1874 and 1882. Originally classified the E class, per Queensland Railway's classification system they were redesignated the B12 class in 1890, B representing they had three driving axles, and the 12 the cylinder diameter in inches.
All were withdrawn from Queensland Railways service by July 1929 and most were scrapped, however the remains of number 28 are derelict at Normanton and components of number 40 are at Cooktown.
Number 31 was sold to the Aramac Shire Tramway in 1911 and remained in service until 1939. Although it was condemned and copper in the boiler sold for scrap, the remainder of the locomotive remained largely intact until 1963. The boiler is now privately owned and stored at Kallangur. The remainder of the locomotive and tender are still at Aramac.