Wave energy — using the ocean's waves to generate electricity — just got a big thumbs-up from the government of Scotland.

The world's largest wave farm has been approved for construction near the Isle of Lewis, located off Scotland's northwestern coast.

When completed, the wave farm will generate 40 megawatts of electricity, enough to power about 30,000 homes, the BBC reports.

Scotland's location on the eastern edge of the North Atlantic makes it an ideal place for wave energy and other renewable energy projects, according to Fergus Ewing, energy minister of Scotland.

"With 10 percent of Europe's wave power potential and 25 percent of its offshore wind and tidal power potential, the opportunities for Scotland are enormous," Ewing told The Herald.

"Scotland has a world-leading resource and is a hot-bed of innovation and talent, making marine energy an exciting green growth sector," Ewing said.

The project, to be developed by wave-energy firm Aquamarine Power, will install between 40 and 50 of the company's "Oyster" devices to harness energy from the ocean's waves.

Wave energy has been promoted as an ideal source of electricity for the 21st century, with some advantages over solar and wind energy, since waves continue to generate power after the sun has gone down and on days when the wind doesn't blow.

But wave energy has been a late bloomer compared to those other sources of renewable energy. This is partly due to the engineering constraints involved in harnessing power from an inhospitable marine environment where storms, tidal currents and salt water can wreak havoc on electrical equipment.

Green energy advocates welcomed news of the Scottish project, which is expected to begin producing power by 2018, according to The Herald.

Lang Banks, director of environmental group WWF Scotland, celebrated the wave farm as a "very welcome and timely boost for the wave power industry in Scotland."

Follow Marc Lallanilla on Twitter and Google+. Follow us @livescience, Facebook & Google+. Original article on LiveScience.com.