Royal Dutch Shell RDS.A 2.33% PLC bet big on natural gas as the energy source of the future when it bought BG Group for $54 billion. Five years later, it appears the gas era won’t last long.

Falling prices for wind and solar power, coupled with government and businesses’ new green goals, are accelerating a shift to cleaner energy and leaving natural gas—long seen by energy companies as a bridge between fossil fuels and renewables—in the lurch. The fuel is also under growing scrutiny for methane leaks, leading some potential customers to skip gas and move ahead to lower-carbon alternatives.

That is a risk for Shell and rivals such as Exxon Mobil Corp. and Total SE, which also invested in gas, given that gas projects typically cost billions of dollars up front and take decades to recoup that investment.

Shell last month halved its outlook for global gas demand growth to 1% a year, and said demand for the fuel could peak as soon as the 2030s.

While burning gas emits less greenhouse gas than coal does, environmental gains are lost if there is a leakage of methane, the main component of natural gas. Methane is more potent than carbon dioxide in contributing to climate change and has become a target of environmentalists.

“If you look at the global gas industry, its role in the energy transition and in the world energy mix decades from now is up for grabs,” Maarten Wetselaar, who heads Shell’s gas business, said at a conference last month, adding that more action to reduce methane leakage was needed.

An inspector looking for leaks at a Shell oil and gas well site in the Permian Basin in 2019.

PHOTO: JAMES DURBIN FOR THE WALL STREET JOURNAL

Shell is using infrared cameras, lasers and satellites to detect methane leaks at production sites, during transportation and at power stations. It has also pushed for policies to reduce methane emissions from the oil-and-gas industry in the U.S. and Europe. Shell targets methane-emissions intensity below 0.2% on all its assets by 2025. Many energy companies don’t have targets.

The company has also started selling carbon-neutral cargoes of liquefied-natural gas, in which emissions can be offset with carbon credits, and is spending millions of dollars on projects to capture and store carbon.

Shell said natural gas emits about half as many greenhouse gases and less than one-tenth of the air pollutants as coal does when it is used to generate electricity. The company added that it can still grow its gas business, with demand particularly strong in Asia, and that it will increase the fuel’s share of its production to 55% in the next decade, from roughly equal with oil today.