The Duke and Duchess of Cambridge found themselves on the wrong side of the tracks when they made an impromptu stop to see a Canadian steam train.
After walking through clouds of steam to clamber inside the cab - and taking the chance to blow its whistle - they had to make the return journey but were left cautiously watching every step, during a visit to the tiny wilderness hamlet of Carcross in the Yukon yesterday.
The locomotive had stopped close to the end of a railway bridge that crossed a stretch of water and although the drop below their feet was not a long one, there was no rail to stop them falling.
William decide to get a closer look at the locomotive after hearing how his grandparents the Queen and Duke of Edinburgh had travelled in the last carriage of the train which was specially fitted out with a marble table for their 1959 visit.
First Nation chief Andy Carvill, 52, of the the Carcross Tagish, who hosted the royal couple's visit to his settlement, said: "The Duke asked if he could go in and they got inside the train and blew the steam whistle.
"I told them about the Queen's coach and they were pleased to hear that."
William and Kate's escapade came at the end of a day where the royal couple sent their first joint public tweet - to sign a virtual visitors' book - and it emerged that Prince George and Princess Charlotte had spent Tuesday at a petting zoo in Victoria, British Columbia while their parents were visiting the Yukon.
William and Kate's foray into the world of social media had a twist as they used old technology - in the form of a morse code telegraph machine connected to a pc - to send their virtual message during a visit to Yukon history museum in Whitehorse.
The dots and dashes were tapped out by Doug Bell, a former commissioner of Yukon, but the royal couple both held the lever down to send the tweet, posted under the Twitter account Telegraph to Tweet, which said: ''The Duke and Duchess of Cambridge, September 2016, Whitehorse Yukon.''
At the Cambridges' base in Victoria their children had been taken to the Beacon Hill Children's Farm by their nanny while mother and father had a night away in the old gold rush town of Whitehorse in the Yukon.
The trip was made public by Victoria Tourism, which tweeted George and Charlotte's secret escape.