In Ouarzazate, Morocco's gateway to the Sahara Desert, more than half a million curved mirrors form gigantic circles.
Every few minutes, the mirrors rotate to better direct sunlight towards tubes full of synthetic oil, making it so hot, it turns into vapor. A turbine uses the vapor to produce enough power for 1.3 million people.
This is the Noor Ouarzazate complex, the largest concentrated solar farm in the world.
In a coastal town in southeastern Morrocco, lies another renewables mega project — the Tarfaya wind farm. With 131 turbines, it is one of the largest of its kind in Africa.
"We benefit from solar radiance and wind levels that are among the highest of any country in the world," said Ghalia Mokhtari, a lawyer and energy specialist with the Moroccan Institute of Strategic Intelligence, a think tank based in the capital Rabat.
And the country's leaders are trying to harness those renewable resources to make Morocco a green leader in Africa, she added. The goal is to reduce climate-warping greenhouse gas emissions by 18.3% by 2030.
The push for green energy dates back to the 2000s
The country's solar and wind expansion has been long in the making, dating back to a 2009 energy plan. The goal was to reach 42% of installed renewable power capacity by 2020.
"King [Mohammed VI] wanted to turn Morocco into a green energy hub because of climate change," said Mokhtari.
Like most African states, Morocco's carbon emissions are tiny compared to industrialized nations and major historical polluters. But it's feeling the harsh consequences of the climate crisis, from scorching heat and droughts to coastal flooding, all of which are worsening food insecurity and water scarcity.
But, added Mokhtari, the country's leadership also wanted to expand renewables, "because we relied heavily on energy imports from Algeria and Spain."
The country still imports 90% of its energy and relies primarily on fossil fuels.
In a bid to wean itself off foreign hydrocarbons, Morocco opened its renewables market to private competition and phased out petrol and diesel subsidies when oil prices were low in 2014 and 2015. But butane gas, popular in households and agriculture, still receives much government support.
Morocco missed its target but is on the right track
The 2009 energy strategy proved to be slightly too ambitious: Morocco missed its 2020 target for renewable power capacity by 5%. But the government seems to be on track to meet a 2030 target of 52%, according to a recent report by the consulting firm Ernst & Young (EY).
According to the analysis, Morocco is punching considerably above its weight in the renewables market given its small economy. And with two new solar power plants and a wind farm being inaugurated in the last year, renewable energy supply rose by almost 10%.
Besides the electricity sector, Morocco also has its eyes set on decarbonizing other areas like transport or agriculture. It shows huge potential to produce green hydrogen, which is being touted as an alternative fuel to replace oil and diesel in heavy industry and aviation, according to the report.
Still, green hydrogen requires huge amounts of clean energy to produce, which, according to German environmental think tank, the Heinrich Böll Foundation, is still in too short supply in the country in spite of its gains. Although, international demand for the alternative fuel could bolster Morocco's renewables expansion, it added.
Recently, the country also signed a deal with the European Union for a "green partnership" to boost cooperation on renewables.
"There is no doubt ... that Morocco has the natural resources, regulatory support and government commitment to lead Africa's green revolution," said the EY report.
Challenges to a renewables revolution
Still, Morocco faces significant challenges in its transition to green energy. Fossil fuels still power most of the country. Coal, which is especially polluting, makes up 37% of electricity production and is getting more expensive due to sanctions on Russia. The country has also come under fire for commissioning new coal power plants and extending the life spans of others.
And Climate Action Tracker, an independent scientific monitoring group, says the country needs more international support to get on the pathway to decarbonization.
Civil society organizations have also criticized the state's focus on giant power plants over small-scale projects, according to the Heinrich Böll Foundation. NGOs say local populations have no say in the projects and don't benefit from jobs.
At the same time, power demand is also soaring. As the population grows and the country develops, consumption could quadruple by 2050. To plug that demand with green energy, the country still has a long way to go, according to the Heinrich Böll Foundation.
Morocco's King Mohammed VI urged the government to speed up the development of new renewables projects at a recent meeting.
"By building on its progress, Morocco should accelerate the deployment of renewable energies in order to strengthen its energy sovereignty, reduce energy costs and position itself in the low-carbon economy in the decades to come," said the monarch in a statement.
Edited by: Jennifer Collins