New Senate Majority Leader Bill Frist won his first major legislative victory late Thursday after the Senate passed a $390 billion government spending package for the current fiscal year -- one that will meet President Bush's requested spending limits.

The bill's 69-29 passage, wrapping up funding for the fiscal year that started nearly four months ago, marked a win for the chamber's majority Republicans, who battled -- and sometimes used budget sleight of hand -- to keep the price tag within the limits Bush demanded.

Democrats, clearly unhappy with their failure to add up to $350 billion in additional spending, said the bill shortchanges everything from hiring food inspectors to helping low-income school districts.

"They once again have failed to address some really critical areas: hospitals, education, homeland security," Sen. Richard Durbin, D-Ill., said of Republicans.

The measure is a collection of 11 bills financing every agency except the Pentagon. The overall spending package was left hanging in the wind for a third of a year as the two sides got mired down in election-year politics, with Bush demanding lower spending than Democrats and some Republicans wanted. House GOP leaders chose to avoid a potentially embarrassing campaign-season defeat for the president by shelving work on the legislation.

The Defense Department's budget was enacted last fall.

The sixth day of debate saw Democrats once again try and fail to boost spending for several programs.

Senate Minority Leader Tom Daschle, D-S.D., failed in his attempt to double the $3.1 billion agricultural spending measure. The bill was defeated 56-39. Instead, senators voted 59-35 for an alternative by Sen. Thad Cochran, R-Miss., focusing more of the money already in the bill for growers and ranchers hurt by natural disasters.

Presidential candidate John Edwards, D-N.C., lost his effort to toughen industrial pollution controls.

The Senate also rejected Wednesday a proposal by Sen. Russell Feingold, D-Wis., to restrict U.S. training of Indonesian military officers until that country cooperates more in an investigation into last summer's murder there of two Americans.

Massachusetts Sen. Ted Kennedy's amendment boosting education money was shot down, as was his effort to add $118 million to five minority health programs. West Virginia Sen. Robert Byrd's repeated attempts to increase homeland security cash by $5 billion were all beaten back. Democrats suggested that to protect the nation without more money, the president will need a magic wand.

"We want to see how this magician is going to make the security better with no new dollars, fewer agents, poor computers. It doesn't make any sense," said Sen. Chuck Schumer, D-N.Y.

But Frist, R-Tenn., countered that security matters and other priorities are adequately funded and that throwing cash at some problems is not the solution

"We don't have unlimited money and we can't solve every problem in the world and not every problem can be solved by spending more money," he said.

In the kind of day that inspired the classic comparison of legislating with sausage-making, senators and aides huddling in the back of the Senate chamber argued, lobbied and cut deals on scores of last-minute additions to the package.

Periodically, clusters of amendments carrying lawmakers' pet projects would be approved by voice vote, often with only the number assigned to each one being announced.

In that manner, the Senate approved $500 million in food aid for African nations ravaged by famine. The Senate had rejected a $600 million version of the measure on Wednesday by 48-46 in a vote that seemed to discomfort several Republicans, but sponsor Sen. Bill Nelson, D-Fla., lobbied GOP leaders Thursday and won a reversal.

Sen. Mitch McConnell, R-Ky., won language letting his home state operate its own retirement system for some public employees. Sen. Peter Fitzgerald, R-Ill., got a provision pressuring the International Red Cross to allow participation in its activities by Israel's Magen David Adom Society, which the 178-nation organization has spurned.

Sens. John Breaux and Mary Landrieu, both Louisiana Democrats, got $3 million to help their state's oyster industry recover from recent hurricanes. The Senate also accepted an amendment by Sen. Ron Wyden, D-Ore., clamping a moratorium on the Total Information Awareness program, a Defense Department project aimed at mining government data to identifying potential terrorists.

Lawmakers agreed to add $120 million for local health programs, sponsored by Sen. Patty Murray, D-Wash. The affirmation came when Senate Appropriations Committee Chairman Ted Stevens, R-Alaska, said there was extra room in the bill.

They also approved an extra $1.5 billion for education for disabled children. But the money will be for the government fiscal year that starts next Oct. 1, which under Congress' budget rules means it won't count toward the bill's price tag for this year.

Senators agreed to two smaller measures -- $180 million to combat AIDS in Africa and $165 million for security screening of people entering the United States.

The increased spending was largely paid for by new congressional estimates that parts of the bill, including higher Medicare reimbursements to rural hospitals, will cost less than expected earlier. Medicare money is generally not part of the discretionary spending that is negotiated each year.

Whenever the Senate does wrap up its budget business, it will have to compromise with the House on differences in each chamber's bills. That could extend negotiations until February, Senate Appropriations Committee Chairman Ted Stevens, R-Alaska, said, denying the president the victory he had hoped to have in time for his State of the Union speech next Tuesday.

It's also unclear how the final version will stay within limits Bush wants while accommodating extra money the Senate approved for education, election reform and other programs -- increases the Senate paid for by 2.9 percent across-the-board cuts in the rest of the bill. House aides say their bargainers will not accept those cuts.

The White House has already objected to the bill's lack of restrictions on federal funds for abortions for federal workers and federal prisoners. And the measure has less than Bush wants for several programs, including disaster relief and Pell grants for low-income college students.

Fox News' Carl Cameron and the Associated Press contributed to this report.