Democrats and Republicans have been arguing for weeks over procedural issues, holding up the five-year bill that would extend and expand crop and dairy subsidies along with popular nutrition aid programs, including food stamps.

The agreement, which allows each party to offer 20 amendments, could allow the Senate to pass the legislation before the end of the year. The House passed its version in July.

"I'm happy with this agreement," Senate Majority Leader Harry Reid, D-Nev., said on the Senate floor Thursday evening. "It's going to be a lot of work, but we're going to finish the farm bill before we leave unless something untoward happens."

Reid had scheduled a vote to cut off debate for Friday, a move that North Dakota Sen. Kent Conrad said put pressure on Republicans to come to a deal. A Nov. 16 attempt to cut off debate fell five votes short of breaking a Republican filibuster after four Republican senators — John Thune of South Dakota, Charles Grassley of Iowa, Norm Coleman of Minnesota and Gordon Smith of Oregon — crossed party lines and voted with Democrats. Coleman and Smith are up for re-election next year.

"Republicans in farm country did not want to go through another cloture vote," said Conrad, referring to the attempt to cut off debate.

Coleman said Democrats were also under pressure to move the legislation.

"I think common sense prevailed, based on pressure from folks on the floor, an understanding that this needed to be done," he said. "America needs a farm bill, our constituents need a farm bill."

Though politically popular, the $286 billion bill stalled for a month in the dispute between the parties. Senators from both parties had offered hundreds of amendments, including several from Republicans dealing with controversial tax and immigration issues. Republicans blamed Reid for attempting to limit the amendments.

The Bush administration has threatened to veto the bill, which would expand subsidies for some crops and allow some wealthy farmers to continue receiving government checks.

Copyright 2007 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.