House Speaker Nancy Pelosi, at left, announced Tuesday she had a deal with Treasury Secretary Steven Mnuchin, pictured at right, to fund the US federal government until December.
CNN  — 

House Speaker Nancy Pelosi and Treasury Secretary Steven Mnuchin clinched an agreement Tuesday to take the threat of a government shutdown at the end of the month off the table.

The bipartisan accord, which comes after several days of back-and-forth between Democrats and Republicans over the stopgap funding measure, would fund the government through December 11.

Members of the House approved the deal shortly after it was announced, by 359-57, with one member voting present.

The agreement includes tens of billions in funds for the Commodity Credit Corporation – a priority for Republicans and bipartisan members from agricultural states and districts, which will replenish crucial aid to farmers. The aid will come with some restrictions, after Democrats raised concerns that the money was being utilized by the Trump administration to distribute funds to favored political interests.

The measure also includes nearly $8 billion in nutrition assistance – a central Democratic priority during the negotiations.

“We have reached an agreement with Republicans on the (continuing resolution) to add nearly $8 billion in desperately needed nutrition assistance for hungry schoolchildren and families,” Pelosi, a California Democrat, said in a statement Tuesday. “We also increase accountability in the Commodity Credit Corporation, preventing funds for farmers from being misused for a Big Oil bailout.”

After negotiations broke down, Democrats initially drafted a stop-gap measure that left out the farm aid and nutrition assistance and were scheduled to vote on that measure earlier in the day on Tuesday.

But the threat of moving the measure without bipartisan consensus – and the possibility that Democrats from agriculture-heavy districts would defect – served to raise the risk of a government shutdown given the narrowing timeline before the September 30 government funding deadline.

Both sides returned to the table and hammered out the deal throughout the course of the day. The Senate is expected to take up the legislation in the coming days.

This story has been updated with additional developments Tuesday.

CNN’s Haley Byrd contributed to this report.