The class C79 was a 4-4-0 locomotive built for express and mail service. Introduced in 1877, it was the first locomotive of the NSWGR ordered in larger numbers. The first 30 were built by Beyer-Peacock between 1877 and 1879, followed by 26 from Dübs in 1880 and 1881. Four more were delivered by Beyer-Peacock in 1881. Eight more were built locally by Atlas Engineering Works at Haymarket, a suburb of Sydney.
With the arrival of the 4-6-0 class C32 (the later P6) in 1892, the C79 was increasingly used in secondary roles. Between 1896 and 1902, 20 locomotives were rebuilt into the 4-4-2T class CC79 for suburban service, with the others being renamed to class C80. From 1901, most got a new boiler with a larger Belpaire firebox instead of the round-topped one.
With the new class scheme of 1924, the C80 became class Z12 and the CC79 became Z13. 23 of the original 4-4-0 which had been in use in suburban service were withdrawn between 1928 and 1933. The remaining locomotives soon left the Sydney area and were used on branch lines. Most survived until the fifties and some until the sixties. Three each of the classes Z12 and Z13 have been preserved.