The event is being hailed as a double celebration for Her Majesty who, on the same day, will become Britain’s longest serving monarch – surpassing the record of her great, great grandmother Queen Victoria.

Accompanied by Prince Philip, she will board a train drawn by the steam locomotive, Union of South Africa, at Edinburgh Waverley and travel the route to Tweedbank.

Only one stop is scheduled – at Newtongrange in Midlothian – although Transport Scotland says “celebrations” are planned at either end of the line.

Also making the journey will be Scotland’s First Minister Nicola Sturgeon and Cabinet Secretary for Infrastructure Keith Brown.

“It is a great honour for us that Her Majesty has chosen to mark her milestone by leading the celebrations for the opening of the Borders Railway,” said Mr Brown.

“The people of the Borders and Midlothian have waited almost half a century to see the return of their railway and it is fitting these two historic events coincide.

“We are also ensuring the people who have campaigned, worked hard and shown such patience through this process are able to play a full part, with a separate day dedicated to them.” That is a reference to Saturday, September 5, when community events are planned along the route and Golden Ticket holders will have the honour of making inaugural journeys.

Councillor Graham Garvie, convener of Scottish Borders Council, said: “The railway is the most significant project in our region for generations and we are thrilled to welcome Her Majesty to formally open the line.

“The fact this occasion coincides with her becoming Britain’s longest serving monarch make it unique in the history of the Borders.” Stretching 30 miles, the Borders Railway is the longest domestic railway to be built in the UK for over a century.