Thousands of people are still without power as clear-up operations continue in the wake of Storm Ali.

Rail services were also still disrupted on Thursday following the storm which swept Scotland on Wednesday, with winds of more than 100mph.

Engineers have worked through the night to clear debris from railway lines and repair power lines.

On Thursday morning, 5,000 Scottish Power customers remained without electricity, down from 10,000 overnight, with Dumfries and Galloway and the Borders worst affected.

Scottish Power said that 600 engineers were working to reconnect customers and hopes to restore power to all of them by the end of the day.

The company said the storm has caused a lot of damage because the trees which have come down are still in full leaf.

SSE said 750 customers were without power on Thursday following the storm, and it has reconnected 24,750 customers in total.

On the railways, some passengers were facing disruption but services were returning to normal.

ScotRail posted photos of trains with broken windows and other damage on Twitter and wrote: “We know some services are very busy this morning with fewer carriages. #StormAli has battered our trains and some need to be repaired before we can bring them back into service.

“Our depot teams will do this as quickly as possible. Thanks for your patience.”

The company said that customers with unused tickets for Wednesday will be able to use their ticket for travel on Thursday.

A ScotRail Alliance spokesman said: “We are really sorry to customers for the disruption that has been caused by Storm Ali. We are continuing to work flat out to keep people moving and our advice to customers is to check your journey before you travel.”

Transport Secretary Michael Matheson told BBC Radio Scotland’s Good Morning Scotland programme: “In the course of yesterday it was clear that the rail network in particular bore the brunt of the impact of the storm, which resulted in widespread disruption.

“A considerable amount of work has gone on over the course of the night to try and get the rail network back up to speed. Network Rail staff have been out trying to repair the damage that has been caused  to overhead power lines, to clear the debris – from trees through to trampolines – off the lines, to get the trains back running again.

“And by and large, most of the services are back operating at a normal level, but it will take the rest of the day to get it back up to 100% again.”

Cruise liner broke from its moorings
Cruise liner Nautica broke loose from its moorings in Greenock in high winds (Andrew Milligan/PA)

Storm Ali caused widespread damage on Wednesday as high winds swept the country.

In Fife, footballers from the University of Dundee had a lucky escape after a tree fell on their coach on the way to a game in St Andrews.

A freight train hit tree branches and left the track near Culloden in the Highlands and a man had to be rescued after becoming trapped under a digger in a river in the village of Rogart in the Highlands.

Meanwhile, passengers on the Nautica cruise liner were stranded in Greenock after the vessel slipped its moorings in high winds.