Hundreds of local residents have been treated to a ride on the new Borders Railway ahead of its public opening.
Around 5,000 people living in Midlothian and the Borders marked the end of a near 47-year wait for train services to return to their part of south-east Scotland with a series of community events, and many were able to board the train by winning "golden tickets".
The line is the longest new domestic railway to be built in the UK for over a century and takes passengers on a 30-mile journey from Edinburgh through Midlothian to Tweedbank in the Scottish Borders.
The £294 million construction project, which officials say was delivered on time and on budget, re-establishes part of the former Waverley line, which fell victim to the controversial Beeching cuts on January 6 1969, leaving the Borders region without any access to the National Rail network.
Scheduled services carrying the first fare-paying passengers will begin on the new route on Sunday.
Golden ticket winners Brian and Carolyn Martin were on the VIP train from Eskbank.
Mr Martin's grandfathers both worked for the railways and he said they would have "both been absolutely delighted" to see the line reopen.
Other passengers included Isabel Allen and her friends, who described the day as "fantastic".
She said: "The 'golden girls' had a fantastic day. People were waving flags as the train passed.
"The atmosphere was just great and we thoroughly enjoyed the chance to reminisce about the railway and our childhoods."
The reopening of the route - which is initially expected to carry almost 650,000 passengers a year - has also been hailed as a remarkable achievement for the grassroots campaign to get the line working again.
Hugh Wark, project director for Network Rail, said: "It's been a hugely complex project - 30 miles of railway delivered in under three years. It's quite an achievement.
"I believe it will be hugely successful. It's a marvellous railway, so let's really get the best benefits out of it that we possibly can.
"I can remember the line when it closed in 1969 and it was hugely controversial at the time. I never dreamt in my career that I would be involved in reopening this railway."
Officials hope one million passengers a year will be using the railway by 2020.
The Queen will officially open the railway on Wednesday with a special steam train trip marking the day she becomes Britain's longest-serving monarch.
Tourism chiefs hope the 55-minute service will boost visitor numbers to Midlothian and the Borders - an area known for its mining heritage, textiles and the landscape which inspired Sir Walter Scott.