The Senate on Wednesday began debating a massive $390 billion bill financing every federal agency but the Pentagon, and Democrats immediately launched a long-shot bid to boost its funds for food safety, border controls and other domestic security programs.

Majority Republicans began trying to push the legislation — which was 1,052 pages — through the Senate in hopes of finally ending a partisan dispute over this year's budget that has stalled action since last summer. The measure combines 11 overdue bills covering every program from NASA to the FBI for the federal budget year that started last Oct. 1.

Addressing one politically sensitive area, Republicans squeezed $3.1 billion into the measure to help farmers and ranchers battered by last summer's drought. That was about half the $6 billion the Senate approved by a wide bipartisan margin last September as congressional elections approached. Democrats planned an amendment that would boost those funds.

In a sign that those funds might grow, Sen. Pat Roberts, R-Kan., complained that the drought funds would go to virtually all farmers, including those from regions where growers did not suffer crop losses. Roberts, a senior member of the Agriculture Committee, did not rule out an effort to increase the measure's aid for farmers hurt by the drought.

The GOP bill would also provide $763 million for Amtrak, the struggling, federally backed passenger carrier whose officials have said they need $1.2 billion this year to survive. Amtrak President David L. Gunn reiterated that threat on Wednesday, saying he would support a Democratic effort to provide the full $1.2 billion.

If that amendment fails, Gunn said, "Amtrak will have no other choice but an orderly shutdown of all service this spring or sooner. The funding level in the bill as it currently stands offers no other alternative but an orderly shutdown of all Amtrak service."

Overall, the bill would provide $12 billion more than in 2002, not including one-time emergencies like the immediate costs of rebuilding New York and the Pentagon after the Sept. 11 attacks, White House officials said.

President Bush had insisted that lawmakers hold the price tag to $385 billion, arguing that restraint is needed with deficits back and the administration fighting terrorism and trying to revive the economy. But Republicans added an extra $825 million for the costs of fighting last summer's wildfires, and the White House was expected to go along.

The White House and lawmakers also added $3.9 billion for last-minute defense items, largely for classified intelligence programs, said aides speaking on condition of anonymity.

White House officials have lobbied Republican senators to vote against expected Democratic amendments to add funds for homeland security and other popular programs like schools, Amtrak and efforts to fight corporate fraud.

"Those who want to pile billions of dollars on top of spending growth already in these bills really are disqualified from the ranks of those concerned about deficits," White House budget director Mitchell Daniels said earlier in the day.

Democrats complained that it was also $9.8 billion short of the amounts they approved last year when they controlled the Senate and wrote — but never enacted — the same measures.

"The president has now thrown down the gauntlet," said Sen. Robert Byrd of West Virginia, top Democrat on the Senate Appropriations Committee, who offered the amendment to boost domestic security spending by $5 billion.

The GOP also provided $1.5 billion to help state and local government modernize their voting systems, and about $1.5 billion more to boost Medicare reimbursements to rural hospitals and doctors.

To free up money for the drought, election overhaul and Medicare funds — which were not in an earlier draft of the bill — Republicans cut 1.6 percent from every other program in the huge measure.

The only two spending bills for this year that have already been enacted cover the military.

When the Senate finishes the measure, House-Senate bargainers will have to write a compromise that can be sent to Bush for his signature.