More than 2,000 homes in Shirebrook were left without power overnight after a fire at an electrical substation in the town.
Firefighters from Shirebrook, Warsop and Chesterfield were called to the blaze on Alandale Avenue shortly after midnight.
An investigation into the cause of the blaze has now started.
Western Power Distribution said the outage affected 2,609 customers, who lost supplies at 11.48pm.
A spokesman said 1,799 properties were restored within three minutes and a further 660 inside 45 minutes.
Power returned to normal for the remaining 150 customers by 3.38am.