The Morayshire Railway was the first railway to be built north of Aberdeen, Scotland. It received royal assent in 1846 but construction was delayed until 1851 because of the adverse economic conditions existing in the United Kingdom. The railway was built in two phases with the section from Elgin to Lossiemouth completed in 1852. When the Inverness and Aberdeen Junction Railway (I&AJR) reached Keith via Elgin, the Morayshire was able to complete the Speyside second phase by connecting the Craigellachie line at Orton. Initially, the Morayshire ran its own locomotives on the I&AJR track between Elgin and Orton but this was short-lived and the Morayshire carriages were then hauled to Orton by the I&AJR. Disagreements with the I&AJR eventually forced the Morayshire into constructing a new sect