Almost 9,000 homes were hit by a massive power outage in Ayr last night.
Much of the KA6 and KA7 postcodes were taken off grid shortly after 9pm following a circuit-breaker fault at the Glengall Lane substation.
Some customers were left without power for almost 12 hours following the outage, which affected huge parts of the town.
Bosses at Scottish Power confirmed engineers were scrambled to the site late last night to carry out emergency repairs.
Scores of customers took to social media to complain after their homes had been plunged into darkness.
The majority were brought back on to the network by midnight but some people remained without power until this morning.
A spokesperson for SP Energy Networks told Ayrshire Live: “We’re sorry that power supplies to around 8,600 customers across the KA6 and KA7 areas of Ayr were affected following a network fault at a local substation around 9pm.
"Engineers attended immediately and supplies were restored to the majority of customers by midnight, with the remaining 22 restored by 3.20am.
"We received further reports around 6.30am this morning of a small pocket of customers without power and our engineers restored their supplies within three hours.
"We’re continuing to investigate what happened and will be carrying out repair works at the substation."
Don't miss the latest Ayrshire headlines – sign up to our free daily newsletter here