Violent, hurricane-force winds ripped across Scotland on Sunday, driving a drilling rig aground. But they also generated record-setting levels of renewable energy.

Scotland's wind turbines produced 39,545 megawatt-hours of electricity, according to WWF Scotland, more than the approximately 37,000 megawatt-hours consumed by the entire population of Scotland that day.

“While it’s not impossible that this has happened in the past, it’s certainly the first time since we began monitoring the data in 2015 that we’ve had all the relevant information to be able to confirm it,” WWF Scotland director Lang Banks told The Guardian.

Renewable energy is already the primary source of energy for Scotland, with wind and hydro making up the bulk of renewables at 62 percent and 29 percent in 2014, respectively. Scotland produces a quarter of the U.K.’s total renewable generation.

Onshore wind is the biggest source of renewable energy in Scotland, but the country also boasts nearly 200 megawatts of offshore wind and hopes one day to be the world leader in tidal power.  

The country’s wind record set on Sunday will likely be the first of many. Scotland has a goal of 100 percent gross renewable energy consumption and 11 percent of renewable heat consumption by 2020.

It was unclear whether all that wind electricity made its way onto the grid for consumption, however. A spokesperson for National Grid said it was not always possible to move energy south due to transmission capacity limitations, although that is something the grid operator is working on.

National Grid did not have details on how much of Sunday's wind was curtailed. Generation sources are prioritized based on cost, however, so wind would likely be the cheapest option available. Bloomberg New Energy Finance has found onshore wind is the cheapest way to produce electricity in the U.K.  

BNEF has also found that wind, followed bysolar will become the least-cost option nearly universally within a decade. A U.S. Department of Energy analysis in 2014 found that onshore wind was as cheap as 2.5 cents per kilowatt-hour.

Although Scotland already has some of the world’s most aggressive renewable targets, a spokesperson for the Scottish government told The Guardian there could be room for even more aggressive policies. Higher targets for renewables could include more ambitious goals for renewable heating or transportation energy options.

“We have a clear policy for an energy mix to provide energy security for the future and will set out our ambitions for an integrated approach to low-carbon technologies within our draft energy strategy later this year,” the spokesperson said. “This will include exploring the option of setting a new renewable energy target.”