There was controversy over the route that such a line might take, but the Caledonian Railway was formed on 31 July 1845 and it opened its main line between Glasgow, Edinburgh and Carlisle in 1848, making an alliance with the English London and North Western Railway.