The bipartisan budget agreement failed its first legislative test early today in a sharp embarrassment to President Bush and the bipartisan House leadership. The overwhelming 254 to 179 House vote against the resolution left a total shutdown again threatening the federal government.

Neither party could produce a majority to support the budget deal that would have set out the overall spending totals of the five-year, $500-billion deficit-reduction plan agreed to by White House and congressional bargainers.

Democrats turned against the agreement despite a promise from House Speaker Thomas S. Foley (D-Wash.) that they could try to change details of the package to make it more politically palatable.

Three-fifths of the House Republicans followed House Minority Whip Newt Gingrich (R-Ga.), who opposed the deal, rather than their president and House Minority Leader Robert H. Michel (R-Ill.), embracing what Michel called "a thousand points of spite."

"This is a sad night for this House, for our political system and for America," House Ways and Means Committee Chairman Dan Rostenkowski (D-Ill.) said after the vote. "Our president has asked us to pull together. Too many of my colleagues have instead given him the back of their hands."

The vote threw the House into disarray and again threatened the shutdown of the federal government at midnight tonight, when a stopgap omnibus spending bill expires. President Bush has vowed not to sign another spending bill if a budget resolution has not been passed.

The House will nonetheless consider a new spending bill today, Foley said. But "I don't expect we'll have an alternate budget today," said House Majority Whip William H. Gray III (D-Pa.). Foley said he and Bush had not discussed alternatives at their lunch yesterday. "We were both thinking positively -- unfortunately, too positively," Foley said.

Asked who might try to revise the budget deal, Foley said, "Whatever the group is, it won't be called a summit."

The resolution was defeated by a combination of conservative Republicans who thought it had too many new taxes and liberal Democrats who thought it cut too much from benefit programs, hitting the poor too hard and sparing the rich.

"This summit package hurts the American people and their economy," Rep. Richard K. Armey (R-Tex.) said before the vote. "It will fail the economy and fail to reduce the deficit."

"This is not a fair package," Rep. Henry A. Waxman (D-Calif.) said beforehand. "If they're willing to change the budget agreement, do it now."

Foley's pledge to allow flexibility in the plan was designed to reassure House Democrats upset over provisions in the agreement ranging from higher taxes on gasoline to higher out-of-pocket costs for some Medicare beneficiaries.

But it also opened the possibility of upsetting the balance of the agreement, which was painstakingly negotiated between Bush administration officials and congressional leaders in nearly six months of talks.

While intended to calm House Democrats, Foley's pledge worried some GOP lawmakers who feared that Democrats would seize the opportunity to make wholesale changes to the pact, which has drawn the ire of voters who would pay more taxes and receive fewer benefits.

The pledge came as President Bush and GOP leaders tried to round up more than half the House's 176 Republicans to vote for a budget resolution that would set out the overall spending totals agreed to by the bargainers.

GOP lawmakers yesterday got letters from Bush, Republican National Committee Chairman Lee Atwater and congressional leaders Michel and Sen. Robert J. Dole (R-Kan.).

"I know that this is a tough vote for many of you," Atwater wrote. "But for the sake of your country and your party, I urge you to stand up for our president." Democratic leaders had insisted that a majority of GOP lawmakers in the House and Senate vote for the spending cuts and tax increases in order to spread the political pain. In the end, neither party could muster a majority to support the resolution: Republicans voted 105 to 71 against it, Democrats 149 to 108.

Foley sought to persuade House Democrats to approve the budget resolution by telling them it would not commit them to the details of the budget summit agreement.

"Many of the policies outlined in the budget summit were for illustrative purposes," he said after emerging from a White House lunch. "It's always been assumed . . . there would be the possibility of looking at alternative policies in order to achieve the same savings."

During their lunch, Foley told Bush that Democratic lawmakers had complained during closed-door meetings that their legislative prerogatives had been usurped by the budget summit negotiators, congressional and administration officials said.

Foley specifically mentioned the uproar among House Democrats over the proposal to raise both the premiums and deductibles paid by beneficiaries in the voluntary Medicare coverage of physicians and outpatient hospital services, congressional officials said.

"There's room here to make the kind of modifications that will improve it a great deal without breaking the blueprint of the agreement," said House Budget Committee Chairman Leon E. Panetta (D-Calif.).

A note in the budget agreement stated: "Except where specifically noted, the policies described are illustrative only. The committees of jurisdiction retain the right to achieve the savings required through alternative policies." But the document stated at another point that the legislation implementing the deal "shall be reviewed . . . to assure its consistency with the Budget Summit Agreement."

Asked what items lawmakers wanted to change, Panetta replied: "Medicare, Medicare and Medicare."

Rep. Fortney "Pete" Stark (D-Calif.), chairman of the House Ways and Means subcommittee on health, has said he would ignore the agreement's provisions on Medicare and would devise a plan of his own.

And there is a long list of other provisions lawmakers wish to change. Rostenkowski and Senate Finance Committee Chairman Lloyd Bentsen (D-Tex.) have both said they do not like the tax breaks for investments in new, small companies.

Further, Rostenkowski said he would like the proposed 10 percent luxury tax to include private aircraft, an item dropped from the final agreement at the urging of Senate Minority Leader Dole.

Northeastern and midwestern lawmakers want to exempt home heating oil from a 2-cent-per-gallon petroleum tax, a move supported by Senate Majority Leader George J. Mitchell (D-Maine), a member of the tax-writing Finance Committee. Rural and suburban lawmakers want to cut the 12-cent-a-gallon increase in taxes on gasoline.

But Republicans feared that the promise of flexibility would mean that the Democrats could take charge of the final budget deal.

"You can't stray too far from the budget agreement," said Rep. Bill Frenzel (Minn.), the House Budget Committee's ranking Republican. "Republicans have no stature in {House} committees."

The administration pressed its lobbying efforts right up to the last minute yesterday. Groups of GOP lawmakers made the trip up Pennsylvania Avenue from Capitol Hill to the White House for audiences with Bush. Commerce Secretary Robert A. Mosbacher roamed the halls around the House chamber, buttonholing Republicans.

"I have not been worked this hard since I came to Congress," said Rep. Mickey Edwards (R-Okla.), a member of the House GOP leadership who opposes the deal. Edwards said he was telephoned yesterday by Vice President Quayle, White House Chief of Staff John H. Sununu, Sen. Phil Gramm (R-Tex.) and former Reagan administration official Drew Lewis.

"There haven't been five people in Washington who haven't called me," Edwards said. Asked if he had spoken to Bush, Edwards replied: "He's one of the five."

"The president called me at a quarter to seven in the morning, and Sununu called two hours later," said Rep. Gerald B.H. Solomon (R-N.Y.), who opposes the plan. "They're not threatening me, and they better not."

Between 50 and 60 House Republicans had breakfast at the White House yesterday with the president.

The disparate group included not only undecided Republicans, but others either strongly committed to support the budget resolution or firmly against it. One administration official said the mix of members was designed to create a "group dynamic" to encourage those lawmakers who were genuinely undecided to climb aboard with the president, despite the political risk of doing so.

With House Republicans rebelling against the new taxes in the package, Bush attempted to convince them that conditions had changed substantially since he pledged in his 1988 campaign not to raise taxes, according to one member who attended. Bush cited the cost of the savings and loan clean-up, the Persian Gulf crisis and looming deficit projections that continue to increase.

"He made the point that he was putting country before self and that's what he was asking members to do," said Rep. E. Clay Shaw Jr. (R-Fla.), who supports the package.

Shaw also said that while Bush described the vote as "extraordinarily important," he also told House members "it isn't the end of the world."

But Bush did not change enough minds. Rep. Bill Schuette (R-Mich.) attended the meeting, but said he remained firmly against the package, even though Bush had gone to Michigan last week to help Schuette raise money for his Senate challenge to Sen. Carl Levin (D-Mich.).

"I listened to him," Schuette said. "The guy feels passionate about it." But, he said, "my responsibilities are to Michigan, period."

Some lobbying was more personal. Rep. Ronald K. Machtley (R-R.I.) said his parents were upset by the proposed changes in Medicare. "They depend on Social Security," he said. "They said, 'Ron, don't do this to us.' "

Staff writers Dan Balz and Steven Mufson contributed to this report.