WASHINGTON — President Trump has ordered Energy Secretary Rick Perry to “prepare immediate steps” to stop the closing of unprofitable coal and nuclear plants around the country, Sarah Huckabee Sanders, the White House press secretary, said on Friday.

It remains to be seen what actions Mr. Perry will recommend, but many of the proposals being floated within the Trump administration, according to a leaked internal memo, would involve drastic government intervention in America’s energy markets.

Under one proposal outlined in the memo, which was reported by Bloomberg, the Department of Energy would order grid operators to buy electricity from struggling coal and nuclear plants for two years, using emergency authority that is normally reserved for exceptional crises like natural disasters.

That idea triggered immediate blowback from a broad alliance of energy companies, consumer groups and environmentalists. On Friday, oil and gas trade groups joined with wind and solar organizations in a joint statement condemning the plan, saying that it was “legally indefensible” and would force consumers to pay more for electricity.