The US generated more electricity from renewable sources than coal for the first time ever in April, new federal government data has shown.

Clean energy such as solar and wind provided 23% of US electricity generation during the month, compared with coal’s 20%, according to the Energy Information Administration.

This represents the first time coal has been surpassed by energy sources that do not release pollution such as planet-heating gases.

April was a favorable month for renewables, with low energy demand and an uptick in wind generation. This means that coal may once again pull ahead of renewables again during 2019, although the long-term trends appear to be set.

“The fate of coal has been sealed, the market has spoken,” said Michael Webber, an energy expert at the University of Texas. “The trend is irreversible now, the decline of coal is unstoppable despite Donald Trump’s rhetoric.”

Trump has repeatedly promised to revive the fortunes of the coal industry, to the delight of voters in mining regions in states such as West Virginia, by repealing various clean air and climate regulations.

However, at least 50 coal-fired power plants have shut since Trump entered the White House in 2017. The falling cost of renewables and gas has caused coal to be dislodged as a favored energy source for utilities.

“Trump has made a promise that will be broken, which is a tragedy for coalminers who were told they don’t need to get other jobs or get new skills,” said Webber. “They have been sent the wrong signal and now there are lay-offs.”

States such as New York and California have, in lieu of any national climate policy, pledged to completely phase out the use of fossil fuels. Many other states are shifting away from coal to gas, with at least 150 new gas plants, and thousands of miles of pipeline, planned in the coming years.

Gas emits less carbon dioxide, which warms the planet, than coal and it is not associated with the same health problems caused by air pollution. But it is still a fossil fuel and some environmentalists have raised concerns that a broad expansion will jeopardize the ability to eliminate greenhouse gas emissions by mid-century, a goal scientists say is essential to avoid the worst ravages of the climate crisis.