The House passed a stopgap bill to avert a government shutdown Oct. 1. It provides funding until Dec. 11.
Negotiations had been stalled over Democrats' opposition to farm aid tacked onto the bill. They say it's there to buy votes for President Donald Trump.
Democrats agreed to the legislation after Republicans conceded to adding money for child nutrition programs.
Lawmakers also added measures to prevent the farm aid from being misused.
It's expected to pass the Senate.