On the morning of 22 May 1915, a train carrying main first world war troops collided with a local passenger service at Quintinshill, near Gretna on the Scottish-English border.
Straight afterwards, a Glasgow-bound express train smashed into the wreckage at the Quintinshill signal box.
The impact set off a devastating fire which engulfed the troop train, packed with nearly 500 members of the Leith Battalion of the Royal Scots.
More than 200 soldiers and 12 civilians were killed and a further 246 people were injured.
The troops were on their way to Liverpool, where they were due to sail to the front line of the war in Gallipoli.
The train was making good time towards Liverpool, but the driver and travelling soldiers were unaware that a passenger train had been mistakenly parked on the southbound main line at Quintinshill. The two trains collided head-on.
Events in Gretna today included a march to Quintinshill rail siding, the unveiling of a roll of honour at Gretna old parish church, and a commemorative tree planting at Gretna Green war memorial.
The Princess Royal laid a wreath beside the roll of honour monument, and a second wreath was laid on behalf of the Royal Scots regiment.
She and Ms Sturgeon will go on to attend a service in Leith tomorrow.
Scottish Secretary David Mundell was also at the service in his Dumfriesshire constituency today.
He said: “A century on, the memory of the terrible disaster at Quintinshill still evokes strong emotions in the local community and across Scotland.”