Coal is on the defensive in the nation’s power industry. Even in coal country.

The pressure to shift more of the country’s electric supply to renewable sources is not just a rallying cry for environmentalists. Some of the power industry’s biggest customers, like General Motors and Microsoft, have made a commitment to clean energy. And to help them meet it — and keep them from taking their business elsewhere — utilities are changing their ways.

West Virginia, where coal is king, is no exception.

Appalachian Power, the leading utility there, is quickly shifting toward natural gas and renewable sources like wind and solar, even as President Trump calls for a coal renaissance. Appalachian Power still burns plenty of coal, but in recent years it has closed three coal-fired plants and converted two others to gas, reducing its dependence on coal to 61 percent last year, down from 74 percent in 2012.

Chris Beam, the company’s president, made the industry’s shifting dynamics clear in an encounter with Gov. Jim Justice, a Democrat, at his inaugural ball in January.

“‘Look, I’d like to see you guys build another coal plant,’” he recalled the governor saying. “And our answer was: We’re not going to build another coal plant.” (The governor confirmed the account, but added in an email, “I’ll continue to encourage power companies to burn more coal to put our miners back to work.”)