Network Rail is set to begin Carstairs Junction upgrade works next month as part of a £164m Scottish Government investment programme.

The programme focuses on the modernisation of a crucial junction for passenger and freight services.

It will help form Scotland’s largest freight loop, which can accommodate 775m-long freight trains.

The work will be completed in three phases. During the project’s first phase, direct services to Glasgow Central and Edinburgh on the West Coast main line through Carstairs will be cancelled.

Under the second phase, part of the junction will be reopened to enable some trains to operate directly to Edinburgh and through diversion routes to Glasgow.

Most services will become normal during weekdays with the junction fully closed each weekend, as part of the final phase.

According to Network Rail, the junction closure will have an impact on cross-border operators, including Avanti West Coast, Caledonian Sleeper, CrossCountry Trains, London North Eastern Railway and TransPennine Express.

Network Rail Scotland route director Liam Sumpter said: “Carstairs Junction is coming to the end of its life cycle and with the volume of freight and passenger trains passing through each week it’s important that we modernise this part of the network.

“By completing this crucial upgrade work we will improve the capabilities and reliability of this strategically important junction, providing better future journeys for passengers and more capacity for freight.

“There’s never a good time to close such an important line but this is a huge and extremely complex piece of work that will safeguard the future of the route for years to come.