WASHINGTON — Efforts to fashion a temporary spending bill needed to avert a government shutdown at the end of the month ran aground Friday amid a fight over farm bailout funding that's a key priority of President Donald Trump and Capitol Hill Republicans.

A House Appropriations Committee spokesman said the measure, which aides had predicted would be released Friday evening, won't be unveiled until next week. The measure needs to be passed by the end of the budget year on Sept. 30 to prevent a shutdown of nonessential government functions.

A tentative proposal by House Speaker Nancy Pelosi to permit Trump to keep awarding agricultural funds this campaign season in exchange for food aid for the poor ran into severe turbulence with both House and Senate Democrats.

The evolving measure is a lowest-common-denominator, bare-minimum bill that befits a deeply polarized Congress. Even so, it took intense efforts at the highest levels of Washington to get the measure this far, but a negotiating flurry Friday fell apart. Neither side wants a partial government shutdown.

Aides following the talks closely said Pelosi initially denied an administration request to add routine flexibility to rules governing Trump's farm bailout efforts, which would freeze his ability to dole out subsidy payments until after the election. Trump is using the funding, over which he has much control, to try to shore up his support in farm country, which has been hit hard by low commodity prices and higher tariffs he himself imposed.

The battle prompted Trump on Friday to blast his nemesis on Twitter: "Pelosi wants to take 30 Billion Dollars away from our great Farmers. Can't let that happen!"

Pelosi then reversed course Friday afternoon to briefly approve the Trump-sought change — only to again change her mind, Democratic and GOP aides said, speaking on condition of anonymity to publicly characterize behind-the-scenes dealings. Pelosi was also seeking a higher food benefit for families whose children are unable to receive free or reduced lunches because schools are closed over the coronavirus.

It's unclear what happens next, but Pelosi retains the option to try to jam the measure through without the farm provision and try to cast blame on Republicans or Trump if it runs aground in the Senate.

Earlier, Republicans denied Democratic requests involving the census and election administration grants. What remains is not controversial and includes provisions that would extend federal highway and flood insurance programs, along with a variety of other low-profile items.

As previously announced, the bill does not contain COVID-19 relief, leaving that issue in all likelihood for a post-election lame duck session — or for the next administration.

The temporary funding measure comes as some Democrats are increasingly upset that an impasse over coronavirus relief is reflecting poorly on the party and as Trump agitates for a deal that's more generous than other Republicans would like.

But with COVID-19 rescue negotiations dead in the water, the stopgap spending bill is likely to be the only measure of note that passes before the election. Not long ago, such measures barely attracted notice, but there have been a handful of government shutdowns over the past few years. Congress has become so dysfunctional that crafting stopgap measures now requires more attention from top leaders.

Pelosi, D-Calif., and Treasury Secretary Steven Mnuchin negotiated the measure, which would keep the government open through Dec. 11. Democrats had proposed next February, apparently to avert any need to reconvene Congress after the election to deal with Trump, who they predict will lose his bid for a second term in November.

In conversations Friday, Pelosi and Mnuchin abandoned efforts to iron out wrinkles involving the census and election administration grants to states, though a heavily lobbied package to extend a number of health programs was likely to be included.

Democrats, meanwhile, were denied $400 million in grants to states to help them carry out elections this fall. Republicans also rejected a push by Pelosi to delay the once-a-decade apportionment of House seats after the census until the next administration.

The House is slated to pass the stopgap funding bill — called a continuing resolution, or CR in Washington-speak — next week. They are likely to then recess for the campaign.

Earlier this week, Pelosi said the House would stay in session until a COVID-19 deal was reached. Instead, lawmakers appear likely to leave Washington next week and be on 24 hours' notice to return if there is a coronavirus relief deal to vote on.

Such a situation would surely create angst among Democrats who are increasingly vocal that Pelosi should do more to ease a weekslong standoff in bipartisan COVID-19 relief talks. Pelosi has staked out a hard line for a COVID-19 package of at least $2.2 trillion, while Republicans controlling the Senate aren't willing to come close to that.

The resulting chasm would only be bridgeable if both sides were to make embarrassing retreats from their stubbornly held positions — something neither side has been willing to do. Instead, they have been devoting their energies to posturing and finger-pointing, much to the dismay of lawmakers who believe a flawed deal is better than none at all.

"We can argue about what the specifics of a plan should look like. But the important thing is that we get back to the negotiating table and hammer out a deal that can be passed into law," said Rep. Stephanie Murphy, D-Fla. "Identify the things that you agree on and build from there to get recovery resources to the American people as soon as possible."

Trump said this week that he wants his GOP allies to go for "higher numbers" that would permit another round of $1,200 direct stimulus payments that would be sent out under his name. Senate Republicans for the most part dismissed the idea.

While Trump is seen as pushing for a deal — any deal — his top negotiators on COVID-19 relief, Mnuchin and White House chief of staff Mark Meadows, have been taking a hard line with Pelosi.