About 1,000 people have attended a service to commemorate the deaths of more than 200 people in Britain's worst rail disaster 100 years ago.
Three trains crashed at Quintinshill in Dumfries and Galloway on 22 May 1915.
One of the trains was carrying hundreds of Leith-based Royal Scots soldiers, most of whom came from the Leith, Portobello and Musselburgh areas.
The Princess Royal and First Minister Nicola Sturgeon attended the memorial service at Rosebank Cemetery in Leith.
Descendants of those who died and former members of the Royal Scots were also at the ceremony.
The soldiers who were on the troop train, bound for Gallipoli, were from the Leith battalion of the Royal Scots.
Following the ceremony, troops paraded along East Claremont Street where Princess Anne took the salute.
The Royal Scots Association - supported by members of the 1st, 2nd and 6th Battalions of the Royal Regiment of Scotland, the descendant regiment of The Royal Scots - held the event which began with a parade from Dalmeny Street to the cemetery.
After the service the troops paraded along East Claremont Street where the Princess Royal, patron of the Royal Scots Association, took the salute.
Association member Andy Kay said the crash had a profound impact on the Leith Battalion and the local community.
"In those days of course there was no such thing as social security. There was a collection which took £4,000, which, in those days, was a huge sum of money," he said.
"That went towards partly building a memorial, and the money that was left went to relatives of the crash, and they also donated a bed to Leith Hospital."
John Edward, the great grandson of Private James McSherry, who was killed, has spent the past year finding descendants of those who died so they could attend the service.
"We wanted to make sure that no-one on the Sunday morning would be turning around and saying 'I wish I had known about it, I wish I had had the chance to remember my ancestors'," he said.
He said relatives had travelled from as far as Jersey, Ontario, the Isle of Wight and Wales.
The service was led by Rev Iain May, minister of South Leith parish church.
One of his relatives was caught up in the disaster.
He said: "Around 50 of the soldiers who died in the crash were members of my parish and when I was looking through the names for this service that I discovered my namesake, John May.
"It turned out he was my grandfather's older brother.
"He was 24 when he died, which is the same age as my son, and looking at photographs from 100 years ago he really looks like my son, which really brings it all home to me."
The chain of events began at 06:50, when a troop train packed with 500 soldiers of the Royal Scots, travelling from Larbert in Stirlingshire, crashed into a passenger service which was stationary on the main line near the border between Scotland and England.
Just over a minute later, an express train travelling north crashed into the wreckage of the first crash.
Gas from the lighting system of the troop train's old wooden carriages caught fire and it took 23 hours to extinguish.
More than 200 soldiers were killed, as well as 12 civilians, although some remains were never identified and the exact death toll is uncertain.
In addition to the deaths, there were 246 people injured.
The two signalmen controlling the line were both sent to prison.
Services have already been held in Larbert and Dumfries.
Britain's deadliest train crash
During World War One the rail network was put under enormous strain. Old carriages, unsuited to high speed travel, had to be brought back into service to transport the troops.
The carriages which transported The Royal Scots that day were lit by gas. The hot coals ignited the gas tanks and set off a huge fire.
There were reports that some trapped soldiers were shot rather than suffer the pain of being burnt to death.
Those soldiers from The Royal Scots who survived the crash looked so destitute when they returned to Edinburgh that they were taunted by schoolchildren who thought they were enemy prisoners of war.
While the signalmen responsible for the crash at Quintinshill were both jailed, they served just over a year in prison and were reemployed in the railways after their release.