The building began at Derby Works in 1840. This was when the North Midland Railway, the Midland Counties Railway and the Birmingham and Derby Railway made engine sheds for their Tri Junct Station. These three merged in 1844 to form the Midland Railway. Then, its first Locomotive and Carriage Superintendent Matthew Kirtley decided to organise their works and persuaded that the railway should build their own rolling stock instead of than buying it.