First Minister Nicola Sturgeon said the news of the deaths of three people in the Stonehaven derailment was “devastating”.
She added that lessons should be learned from the accident, and said her thoughts were with those who work on Scotland’s railway.
She added: “Of course, I’m thinking particularly of the bereaved families who face an experience that all of us dread – coming to terms with the sudden and tragic loss of a loved one.
“No words can ease their pain nor the awful reality that they are now forced to confront.
“But the hearts of a nation are with them today.
“What we can do right now is send them love and support, and in doing so I’m sure I speak on behalf of everyone across Scotland.”
The First Minister also thanked the emergency services for their work to rescue the six people who were injured in the incident.
She said: “The location and the circumstances also presented major logistical and practical challenges for a rescue and recovery operation.
“Our emergency services yet again showed their immense professionalism and dedication to duty and I am so very grateful to them for that.”