SCOTLAND’S transport secretary said the climate crisis is leading to increasing challenges for rail safety after three people died in a derailment following heavy storms.

Train driver Brett McCullough and conductor Donald Dinnie lost their lives along with a passenger when the 6:38 am Aberdeen to Glasgow service came off the tracks and slid down an embankment at Carmont, just west of Stonehaven, Aberdeenshire, on Wednesday morning.

The train is believed to have turned back after encountering a landslide, only to hit another.

Visiting the site earlier today, Michael Matheson said weather had had an impact on the crash.

He said: "What we don't want to do at this particular point is to start to speculate about what actually caused it.

"What I think we can assess, though, is that weather has had an impact.

"We are seeing increasingly a higher level of what are localised intense weather events that are having an impact on the transport network, including the rail network.

"What we need to do as part of the investigation is identify to what extent it had an impact and also to see what lessons can be learned."

He said some parts of the country had seen a month's rainfall in just a couple of hours on Tuesday night and Wednesday morning.

It also emerged that a member of the crew got out of the derailed train to stop any other trains further down the track.

Mr Matheson said recovery crews had worked through the night to stabilise the site and make it ready for investigators.

Network Rail boss Andrew Haines also visited the scene of the crash after cutting short a family holiday in Italy.

He said: "Questions are inevitably being asked as to how this could happen and I am determined that we understand the circumstances that led to this devastating event.

"It's too early to draw conclusions but it is critical that we investigate thoroughly and with care, and work closely with rail safety authorities to make sure this can't happen again."

Scotland's Lord Advocate has asked Police Scotland, British Transport Police and the Office of Rail and Road, the independent regulator, to conduct a joint investigation.

A review of CCTV at stations where the train had stopped suggested there were nine people on the train, including crew, at the time of the accident.

Chief Superintendent Eddie Wylie, of British Transport Police, said he believed all passengers had been accounted for.

He added: "Once the area has been made safe then a full and thorough search will be conducted, which is likely to take some time.

"I know many people will understandably have questions and we will be working closely alongside the Rail Accident Investigation Branch and the Office of Rail and Road to establish the full circumstances of how the train came to derail."

The Scottish Fire and Rescue Service said four firefighters were injured while dealing with the Stonehaven derailment.

Assistant chief officer Paul Stewart told BBC Scotland: "It was clearly a very difficult and hazardous scene yesterday and it remains so and we take the safety of our crews very seriously indeed.

"We did have the unfortunate event of four firefighters receiving minor injuries at the scene yesterday, two of which attended hospital for a precautionary check up and two of which remained at the scene, so a very hazardous and difficult scene but something that the fire and rescue service is well able to manage and deal with."

Prime Minister Boris Johnson also said: “One of the reasons that this accident is so shocking is of course that this type of accident on our railways is thankfully so rare.

“But our thoughts are very much with those who’ve lost their lives, their families and of course those who’ve been injured in the derailment.

“I’ve talked to First Minister Nicola Sturgeon about what has happened and clearly the most important thing now is that the British Transport Police, who are in charge of the investigation, find out exactly what happened, and that we all work together with Network Rail, with everybody else who’s responsible to make sure that nothing like this happens again.”