 When intercity railways were being planned, the North British Railway wished to reach Carlisle from Edinburgh, and it purchased the Dalkeith line in 1845 to secure part of the route.The new owners altered the gauge to the standard 4 ft  in and laid stronger track for locomotive operation.Part of its main line became incorporated into the Waverley Route.