Caerphilly Castle is a member of the GWR 4073 Class built in 1923.
The lead locomotive of its class, after a brief period of running-in service, between April and October 1924 the locomotive was exhibited at the British Empire Exhibition, which was held at Wembley Park, Wembley, north-west London. Its first shed allocation was Old Oak Common. Its August 1950 shed allocation was Bath Road, Bristol. Its last shed allocation was Cardiff Canton in March 1959.
Withdrawn in May 1960, it was made part of the National Collection. Refurbished for display purposes at Swindon Works, on 2 June 1961 she was formally handed over by Dr Richard Beeching at Paddington Station to the director of the Science Museum. Pickfords hauled the engine to the museum in Kensington, using Scammell Constructor units on Sunday 4 June. She was then placed on display in the new extension, in the transport section.
After the Science Museum decided to refurbish its displays, and focus on moving and interactive exhibits, it was decided to move the locomotive to Swindon Steam Railway Museum. After a period on display at National Railway Museum, York, she moved to Swindon on the museum's opening.