The Senate rejected a Democratic effort to pump $5 billion for protecting ports, nuclear plants and other facilities into a huge $390 billion spending bill on Thursday as Republicans rallied behind White House pleas to keep the price tag from rising.

With the near party-line 51-45 vote, GOP senators beat back the first of what were expected to be several Democratic attempts to increase funds for a range of programs in the Amtrak, prosecution of corporate fraud and drought aid for farmers.

Senate Appropriations Committee Chairman Ted Stevens, R-Alaska, said that while he agreed with many of the homeland security needs, Congress must abide by the spending limits set by the president.

"I ask the Senate to exercise a real rare type of discipline," he said.

Republicans distributed a letter from Steve Abbot, the White House's deputy homeland security adviser, calling the extra funds the Democrats want "unnecessary."

Sen. Robert Byrd, D-W.Va., sponsor of the $5 billion amendment, said Bush was being shortsighted in denying extra funds for helping communities bolster local emergency and law enforcement agencies and enhancing security at airports, water supplies and elsewhere. The underlying bill already has $24.7 billion for domestic security efforts.

"If something happens, let the people then look back and see how their Congress sought to add money for border security, for airport security, for homeland security," Byrd said.

Republicans were hoping to quickly approve the 1,052-page bill this week and move a step closer to ending a partisan impasse that has stalled action on the overdue budget bills since last summer. The measure combines 11 bills covering every program from NASA to the FBI for the federal budget year that started last Oct. 1.

White House officials say 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.

But Democrats say the measure was $9.8 billion short of what they approved last year when they controlled the Senate and wrote -- but never enacted -- the same measures.

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.

In a sign that those funds might grow, Sen. Pat Roberts, R-Kan., said 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 said if a Democratic effort to provide the full $1.2 billion fails, "Amtrak will have no other choice but an orderly shutdown of all service this spring or sooner."

Bush has said holding the price tag to $385 billion is necessary with deficits back and the administration fighting terrorism and trying to revive the economy. Even so, 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.

In addition, the GOP included $1.5 billion to help state and local government modernize their voting systems, and $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.