PRIMGHAR, Iowa — In measured but increasingly impatient tones, Midwestern farmers and politicians delivered a message to President Trump: Fix the policies hurting corn prices and prompting ethanol plants to close, or risk alienating one of the most loyal parts of your political base.

And last week, after a flurry of pressure from senators and criticism from agricultural groups, the Trump administration relented, saying that it would put forth rules designed to increase ethanol demand. The decision, which was cheered in a Corn Belt that has also been battered this year by tariffs and floods, underscored the importance of the rural Midwest to Mr. Trump’s re-election hopes and gave a boost to farmers at the end of a difficult growing season.

“It’s exactly what we wanted,” said Daryl Haack , a corn and soybean farmer from Primghar, in northwest Iowa, who supports Mr. Trump but had previously criticized his approach on ethanol.

The turnabout by the administration came amid a backlash at its decision over the summer to exempt more oil refineries from a requirement to include ethanol, a biofuel often derived from corn, in their blends. About 40 percent of the country’s corn crop goes to ethanol, and a drop in demand for the product quickly rippled through the rural economy in places like Iowa, Michigan, Minnesota and Ohio, all politically mixed states that Mr. Trump hopes to carry next year.