WASHINGTON — The House passed emergency short-term legislation Tuesday to cut federal spending by $4 billion and avert a government shutdown. Senate Democrats agreed to follow suit, handing Republicans an early victory in their drive to rein in government.

The bill that cleared the House on a bipartisan vote of 335-91 eliminates the threat of a shutdown on March 4, when existing funding authority expires. At the same time, it creates a compressed two-week timeframe for the White House and lawmakers to engage in what looms as a highly contentious negotiation on a follow-up bill to set spending levels through the Sept. 30 end of the fiscal year.

In the Senate, Majority Leader Harry Reid said the short-term bill would win approval and be ready for President Barack Obama's signature within 48 hours. "We'll pass this and then look at funding the government on a long-term basis," said the Nevada Democrat.

There was no immediate reaction from the White House, which earlier in the day called publicly for an interim measure of up to five weeks.

House Republicans were more eager to draw attention to the bill that was passing with the acquiescence of the White House and Democrats than to the challenge yet ahead.

"Now that congressional Democrats and the administration have expressed an openness for spending cuts, the momentum is there for a long-term measure that starts to finally get our fiscal house in order," said Majority Leader Eric Cantor of Virginia.

"Changing the culture of borrowing and spending in Washington is no small feat, but I am heartened by today's action and it shows that Republicans have started to make the meaningful changes that voters called for in the last election."

The GOP won control of the House and gained seats in the Senate last fall with the backing of tea party activists demanding deep cuts in federal spending and other steps to reduce the federal government.

On the House floor, Democrats sharply attacked Republicans in the run-up to the vote, but much of their criticism was aimed at an earlier $61 billion package of spending cuts that had cleared on a party-line vote.

"The sooner we can agree on a long-term package of smart cuts — not reckless, arbitrary, job-destroying cuts — the sooner we can stop funding the government in disruptive two-week increments that undermine efficiency and spread economic uncertainty," said Rep. Steny Hoyer of Maryland, second-ranking in the Democratic leadership.

When it came time to vote, Democrats split, 104 in favor and 85 against. The leadership was similarly divided, Hoyer supporting the legislation and the party's leader, Rep. Nancy Pelosi of California, opposed.

Republicans voted 231-6 in favor.

Hoyer's reference to reckless cuts was a reach back to the earlier measure, written to satisfy 87 first-term conservative Republicans. It called for $61 billion in cuts while funding the government through Sept. 30, and would also have blocked enactment of proposed federal regulations on an array of private industries and prohibited the use of funds to implement the year-old health care law.

Confronted with a veto threat by Obama and strong opposition in the Senate, House Republicans announced quickly they would follow up with the interim two-week bill to avoid a shutdown while buying more time for compromise talks.

As such, the two-week measure is loaded with symbolism, although the $4 billion in cuts are not particularly controversial. About $2.7 billion was ticketed for earmarked projects, and the balance for education and other programs that Obama had proposed terminating or reducing next year.

The day's events marked the culmination of a slow-motion retreat on the part of Senate Democrats, who had hoped to use the past few weeks to make the case that House Republicans are radicals bent on closing down the government.

As recently as 10 days ago, Senate Democrats supported a spending freeze at current levels through the end of the fiscal year, while making it known some members of the rank and file wanted to make cuts.

Last Thursday, as House Republicans made known their plan for the short-term bill with $4 billion in relatively non-controversial cuts, the Senate Democrats said they were opposed. They said they would agree to reductions only in a bill that carried the government through Sept. 30.

They switched signals again on Monday, as the White House expressed general support for immediate cuts as part of a bill to prevent any shutdown. Reid met privately with Republican House Speaker John Boehner of Ohio during the day, and several officials said later Democrats floated a proposal for a five-week bill with $8 billion in cuts — less than the $2 billion-per-week level House Republicans want.

Privately, Senate Democratic officials expressed displeasure with the White House, saying the administration had remained above the fray in recent days.

Reid gave no hint of any unhappiness, though, telling reporters he expects Obama — who spoke with Boehner by telephone on Tuesday — to become more involved in the next round of negotiations.

"The president's going to take this to the American people because the only message that we have from the Republicans is to wipe out programs that are so important to people, especially people who can't help themselves, the middle class and other programs."

"So, no, we feel we're in a good position. I'm hopeful that we can work something out with the Republicans to get this done," Reid said.