A full 22% of the electricity generated in the U.S. in April came from renewable sources like wind, solar, hydroelectric and geothermal power.

For the first time, the U.S. has generated more energy from renewables than from coal, marking a landmark for non-polluting energy.

A full 22% of the electricity generated in the U.S. in April came from renewable sources like wind, solar, hydroelectric and geothermal power, according to the U.S. Energy Information Administration, which released the official figures this week after early projections emerged in May. Just 20% of power production in April came from coal.

The shift away from King Coal is due to seasonal factors as well as a long-running decline in the number of U.S. coal plants. In the U.S., late spring and early fall typically see the lowest electricity use because of reduced demand for heating and cooling. Meanwhile, generation of hydroelectric—the largest source of renewable electricity—"tends to peak in the spring as melting snowpack results in increased water supply at downstream generators," the EIA said.

Meanwhile, coal—considered the dirtiest electricity source—has been in a long-term decline, with use of the rock dropping to a 41-year low this year. Despite the Trump administration's efforts to prop up the industry, 51 coal plants have closed since the 2016 election. Eight coal companies have filed for bankruptcy protection in the past four years.

"Economics are so in favor of clean energy, the president can't really reverse it at this stage -- the economics are fundamentally so strong," Amy Francetic, founder of Energize Ventures, a technology-focused venture fund, told CBS MoneyWatch previously.

Cheap natural gas—considered a less polluting fuel—has been the primary driver of coal plant unprofitability, but the dramatic price drop of completely renewable energy has also played a part in the last few years.

"We've seen gas creating competition for coal for a while, but now we have renewables getting cheap," Mary Anne Hitt, director of the Sierra Club's Beyond Coal campaign, told CB MoneyWatch recently.

In most of the U.S., it's now cheaper to build a new solar or wind farm than to keep an existing coal plant open. A number of states have passed laws this year moving aggressively toward carbon-free electricity, including New York, Washington, Colorado, Nevada and New Mexico, putting added economic pressure on existing fossil-fuel plants.

"Coal plants in the Southwest are finding that they're surrounded by states with 100% clean energy mandates, or they're just too expensive," Hitt said. "They're not finding new customers."