The Queen will carry out an official engagement on the day she becomes the longest reigning monarch in British history - opening the new Scottish Borders Railway.
On September 9, she will pass the record set by her great-great-grandmother Queen Victoria.
Buckingham Palace has calculated that Queen Victoria reigned for 23,226 days, 16 hours and 23 minutes, taking into account 63 years, 15 leap days and the precise timings of her accession and death.
On the historic day the Queen and Duke of Edinburgh will be joined by First Minister Nicola Sturgeon on a steam train travelling along the new route with celebrations planned for the start and end of the journey.
The £294 million railway, which opens to the public on Sunday September 6, will re-establish passenger services from Edinburgh through Midlothian to Tweedbank in the Borders for the first time in more than 40 years.
Keith Brown, the Scottish Government's cabinet secretary for infrastructure, said: "It is a great honour for us that Her Majesty has chosen to mark this milestone by leading the celebrations for the opening of the Borders Railway.
"The people of the Borders and Midlothian have waited almost half a century to see the return of their railway and it is fitting that these two such historic events coincide.
"This will be a double celebration and we are also ensuring that the people who have campaigned, worked hard and shown such patience throughout this process are able to play a full part in the celebrations, with a separate day dedicated just to them."