In the final clashes of a year of partisan conflict, the Senate dealt defeat Wednesday to legislation allowing oil drilling in the Arctic National Wildlife Refuge, but Republicans salvaged a $39.7 billion package of deficit cuts on Vice President Dick Cheney's tie-breaking vote.

Legislation providing $29 billion in aid to the victims of Hurricane Katrina and other storms cleared with ease. And hours of back-room negotiations yielded a surprise agreement on a Democratic-initiated call for a temporary extension of the anti-terror Patriot Act without changes.

"This has been the saddest day of my life," said Sen. Ted Stevens, R-Alaska, lamenting the demise of legislation to open the wildlife refuge to oil exploration.

Click here to see how your senator voted.

Other advocates of drilling said they would try again next year. But with lawmakers eager to leave the Capitol for the holidays, the bill became one of the highest-profile casualties on the Republican legislative agenda.

The agreement on the Patriot Act signaled that the White House and congressional Republicans will have to accept changes in comprehensive legislation that had seemed on the verge of passage only a few days ago.

As recently as midmorning, Bush sharply criticized supporters of a Democratic-led filibuster that had stalled the measure short of passage last week. Senate Majority Leader Bill Frist had said he would not accept — and the president would not sign — a short-term extension that the Democrats sought.

Republicans "tried to play a game of chicken, and they lost the game of chicken," said Sen. Russ Feingold, D-Wis., a leader in the effort to derail the proposed changes.

Surprisingly, the flurry of activity left several bills short of final passage in a Congress where Republicans hold majorities in both houses.

Senate Republicans said they expected the House to approve a $493 billion defense spending bill — shorn of the ANWR provision — on Thursday. Ditto for the Patriot Act extension.

But Democrats in the House said they would not agree to speed action on the deficit-reduction bill they voted against unanimously earlier this week.

The House approved the measure in the pre-dawn hours of Monday, but the Democrats' leader, Rep. Nancy Pelosi of California, said she will insist it be re-examined "in the light of day" the next time. That's likely to be in February.

A long day and night of political jousting opened with narrow passage of the deficit-cutting bill, which made the first attempt in nearly a decade to curb the growth of federal benefit programs that serve millions.

"It's just a small down payment on the challenges that face this country in the years ahead," said Frist. Sen. Judd Gregg, R-N.H., the chairman of the Senate Budget Committee, said the legislation marked the only opportunity of the year to "reduce the rate of growth of the federal government."

The measure represented one of the top goals of congressional conservatives for the year, although Republicans also pointed out the savings amounted to a small slice of the anticipated federal spending over the next five years.

Democrats said that however it was described, it would fall too harshly on lower-income Americans.

Reid called the GOP legislation "ideologically driven," and Sen. Kent Conrad, D-N.D., denounced it with sarcasm. He said it was prelude to $70 billion in tax cuts for the wealthy that Republicans plan to pass next year, a combination he said would increase red ink. "If you like deficits and debt, if you want to pass on a massive debt to our children, this is your chance."

The legislation, the product of a year's labor for the Republicans, would affect Medicare, Medicaid, student loans and other programs.

Home health care payments under Medicare would be frozen at current levels for a year, and Medicaid would be altered to make it harder for low-income elderly to qualify for federal nursing home benefits by turning assets over to their children.

The student loan program would be targeted for $12.6 billion in savings over five years, much of it from a change that would peg loans to a fixed interest rate. Business would be required to contribute $3.6 billion to the Pension Benefit Guaranty Corp., the federal agency that protects certain pension plans.

As was the case with ANWR, the vote closely followed party lines.

Five Republicans defected on the deficit-cutting votes, including Sens. Olympia Snowe and Susan Collins of Maine, Mike DeWine of Ohio, Gordon Smith of Oregon and Lincoln Chafee of Rhode Island. Snowe, Chafee and DeWine face re-election next year. Also in opposition were all 44 Democrats and Sen. James Jeffords, the Vermont independent.

"The vice president votes in the affirmative," Cheney said from his seat on the Senate dais, having returned early from an overseas trip to cast his tie-breaking vote.

Critics attacked the ANWR legislation on several fronts.

"Our military is being held hostage by this issue, said Sen. Harry Reid, the Democratic leader, one of several lawmakers who attacked Republicans for attaching the ANWR bill to legislation providing money for the wars in Iraq and Afghanistan.

"Destroying this wilderness will do very little to reduce energy costs nor does it do very much for oil independence," added Sen. Dianne Feinstein, D-Calif.

Stevens, who has campaigned to allow oil drilling in the refuge for a quarter-century, made an unusually personal appeal. "Every one of you, have you ever come as chairman of appropriations and tell me you needed help for your state and I have turned you down?" he asked. "I have fought" to help, he added

The final vote was 56-44, four short of the 60 needed to break the Democratic filibuster.

Sen. Robert C. Byrd, 88, and a friend of Stevens for decades, rose to oppose him.

"He is my friend. I love him. But I love the Senate more," said the West Virginia Democrat, arguing that Republicans were breaking the rules to achieve their political purposes.

Stevens responded a few minutes later, speaking more softly than his "Incredible Hulk" necktie might have led spectators to expect. "I've had great admiration for you and I've studied at your feet, but I do not believe that I deserve that speech on the rules," he said.