Nine-day closure during Kilmarnock to Carlisle rail work
The rail line between Kilmarnock and Carlisle is to shut for nine days for upgrade work along the route.
Replacement buses will operate between 15 and 23 July.
Four miles of track is being renewed along the line from Mauchline in the north to Dumfries in the south.
Work in Mauchline will also see two bridges over Ayr Road strengthened and repaired with further bridge works planned at Annan viaduct.
Specialists have been working at that site since May to carry out masonry repairs and strengthening works.
Due to the complexity of the engineering work and the heavy machinery involved, Network Rail said the projects could not be delivered without the short-term closure of the line.
Additional track works will also be delivered on Sundays into August with buses replacing trains between Kilmarnock and Dumfries on 30 July and every Sunday in August.
Lindsay Saddler, head of maintenance delivery for the ScotRail Alliance, said: "The work we are undertaking is vital for the long-term future reliability of the line and part of our commitment to delivering the best railway Scotland has ever had.
"Our engineers will be working around-the-clock to complete this complex programme as quickly as possible.
"We understand the inconvenience these works will cause to some passengers, residents and motorists and we are working hard to keep disruption to a minimum."