The North British Railway was a Scottish railway company, based in Edinburgh. Established in 1844, its network grew from the original Edinburgh–Berwick-upon-Tweed line (completed in 1846) to serve the East of Scotland. It provided the northernmost part of the East Coast Main Line, and at the Grouping in 1923 the NBR – then the largest railway company in Scotland, and the fifth largest in the United Kingdom – became part of the London and North Eastern Railway. For much of its life it had contended for primacy in Scotland with the generally more profitable Glasgow-based Caledonian Railway, the equivalent Scottish component of the West Coast Main Line.