WASHINGTON — Corn growers suffering from the double blows of President Trump’s trade war with China and catastrophic flooding got a boost Friday from the Environmental Protection Agency.

In a move intended as a pick-me-up for the ethanol industry, the agency announced finalized plans to end a federal ban on summertime sales of gasoline mixed with higher amounts of ethanol.

It was sharply criticized by both the oil industry, which doesn’t want to lose more market share to ethanol, a corn-based biofuel, and by environmentalists, who say the change undoes anti-smog regulations.

The new rule allowing year-round sales — something the ethanol industry has long fought for — is essentially an aid package for anxious Midwestern farmers whose votes are crucial to Trump’s reelection campaign.

“We’re doing this because it’s a very important presidential priority,” Bill Wehrum, who leads the EPA’s clean air office, said in a phone call with reporters.

Wehrum did not say the change came with environmental benefits. It would, however, provide a “substantial additional market opportunity for ethanol producers,” he said.

Agriculture industry groups cheered the new rule.

“After years of declining farm income, opening up markets to additional fuel choices for consumers helps create new demand that farmers desperately need,” Zippy Duvall, president of the American Farm Bureau Federation, said in a statement.

But the change faces strong opposition from the oil industry. In a statement Friday, the American Petroleum Institute called the fuel mandate “broken” and accused the EPA of rushing to lift the ban before the start of summer.

Environmentalists also criticized the change, which undoes regulations imposed in 2011 by President Obama’s EPA to reduce smog.

Jonathan Lewis, senior counsel with the Clean Air Task Force, said burning higher-ethanol blends of gasoline produces more of the pollutant nitrogen oxide. This, in turn, leads to more ozone — the lung-damaging gas in smog.

“Corn ethanol is not appreciably better and is potentially worse than gasoline,” Lewis said.

California, which has some of the worst air pollution in the United States, will not be affected by the EPA’s decision because the state doesn’t allow sales of gas with 15% ethanol.

Environmental groups and the oil industry are likely to challenge the rule in court on the grounds that the EPA exceeded its authority under the Clean Air Act.

Wehrum said he was not concerned by the legal threats.

“We believe everything we’re doing is wholly consistent with the act,” he told reporters. “We know there are folks who disagree with us.”