At a two-hour drive from Riyadh, Saudi Arabia’s capital, rows of solar panels extend to the horizon like waves on an ocean. Despite having almost limitless reserves of oil, the kingdom is embracing solar and wind power, partly in an effort to retain a leading position in the energy industry, which is vitally important to the country but fast changing.

Looking out over 3.3 million panels, covering 14 square miles of desert, Faisal Al Omari, chief executive of a recently completed solar project called Sudair, said he would tell his children and grandchildren about contributing to Saudi Arabia’s energy transition. “I’m really proud to be part of it,” he said.

Although petroleum production retains a crucial role in the Saudi economy, the kingdom is putting its chips on other forms of energy. Sudair, which can light up 185,000 homes, is the first of what could be many giant projects intended to raise output from renewable energy sources like solar and wind to around 50 percent by 2030. Currently, renewable energy accounts for a negligible amount of Saudi electricity generation.

Analysts say achieving that hugely ambitious goal is unlikely. “If they get 30 percent, I would be happy because that would be a good signal,” said Karim Elgendy, a climate analyst at the Middle East Institute, a research organization in Washington.

Still, the kingdom is planning to build solar farms at a rapid pace.

“The volumes you see here, you don’t see anywhere else, only in China,” said Marco Arcelli, chief executive of Acwa Power, Sudair’s Saudi developer and a growing force in the international electricity and water industries.