By a vote of 267-151, the House passed a measure to fund government programs until the end of the fiscal year on September 30. The Democratic-controlled Senate is expected to pass a similar bill next week.
Without such legislation, federal agencies would run out of money on March 27.
The bill to continue funding the government without last-minute drama came as Obama took the unusual step of inviting Republican senators to a dinner on Wednesday night at a Washington hotel a few blocks from the White House that lasted about an hour and a half.
An administration official told Reuters Obama was hoping to take advantage of a lull in a series of budget crises to launch a dialogue with Republican lawmakers, which he hopes will lead to a broad deficit-reduction deal.
While the dinner was not intended to be a negotiation, it was an opportunity for Obama to correct the record on a perception among some Republicans that he is unwilling to consider some difficult spending cuts that are unpopular with his fellow Democrats in Congress.
Those could include cuts to programs that include the Social Security pension system and Medicare for the elderly.
Discussion at the dinner was expected to concentrate on budget issues, the official said. Obama will discuss his other legislative priorities, including immigration reform, gun control and tackling climate change, at meetings on Capitol Hill next week.
More From This Section
In another bipartisan gesture, Republican Senate Minority Leader Mitch McConnell said that at his suggestion, Obama will join Republicans for a lunch on Capitol Hill on March 14.
Obama is also due to meet with congressional Democrats next week, the White House said.
The administration and lawmakers offered few details about the dinner, which the White House paid for.
"The president greatly enjoyed the dinner and had a good exchange of ideas with the senators," a senior administration official told reporters.
Asked how the soiree had gone, Senator John McCain told journalists outside the hotel, "Just great. Fantastic."
Attendees included Senators Lindsey Graham, Bob Corker, and Kelly Ayotte. Graham drew up the guest list, the White House said.
The meetings between the president and lawmakers, whether or not they produce results, depart from what has been an at best a stand-offish relationship between Obama and Republicans in Congress.
They suggest that Obama and Republicans are getting the message that public patience with Washington is wearing thin. This has become apparent as Americans read of inconveniences they may soon confront at airports and elsewhere as a result of across-the-board cuts to the federal budget that kicked in on Friday after lawmakers and the White House failed to agree on an alternative.
"This is the first indication in really a long time that the president is willing to exert leadership and bring people together and that's exactly what needs to be done," said Republican Senator Susan Collins of Maine, who has spoken by phone in recent days with Obama.
Republican doubters
At the heart of the bitter US budget dispute are deep differences over how to rein in growth of the $16.7 trillion federal debt. Obama wants to narrow the fiscal gap with spending cuts and tax hikes. Republicans do not want to concede again on taxes after doing so in negotiations over the "fiscal cliff" at the New Year.
Despite the scheduled dinners and meetings and the vote on funding the government, few expect those differences to be resolved any time soon.
Some Republicans remain skeptical of Obama's overtures. "This president has been exceptional in his lack of consultation and outreach to Congress," said John Cornyn of Texas, the second-ranking Senate Republican.
Cornyn, like Collins, was not invited to dinner with Obama, but he warned that talk of tax increases would be unwelcome. "I don't know if the purpose of the meeting is social or if he has an agenda. But if it is about raising taxes, we're done."
While Republicans have taken most of the beating in surveys in connection with the so-called sequestration, a Reuters/Ipsos online poll released on Wednesday showed 43% of people approve of Obama's handling of his job, down 7 percentage points from February 19.
Confounding the White House's efforts to blame Republicans for the spending cuts, most respondents in the online survey hold both Democrats and Republicans responsible.
As recently as last month, Republicans were threatening to use the bill to fund the government, called a "continuing resolution," to extract spending cuts from the White House.
Instead, the bill they fashioned, which passed on Wednesday, embraced the $85 billion in automatic spending cuts that were triggered last Friday, while providing some additional spending flexibility to the military and other security operations.
Republican Representative Tom Cole of Oklahoma said his party would like to shift the cuts to other areas of the budget, noting that there are 20,000 military employees in his Oklahoma district.
"We'll sit down and renegotiate where they should come from," Cole said in the debate on the House floor. "We think we've got some great ideas, but they (the cuts) are going to occur. They're the first and appropriate step for getting our fiscal house back in order."
Many Democrats in the Republican-controlled House voted against the funding bill because it would not give the Obama administration flexibility in carrying out the new, automatic spending cuts for domestic programs such as education. Last month, Democrats had sought to replace about half of the automatic cuts with tax increases on the rich.
"This bill falls short in a number of areas, but most of all because it does nothing to prevent the loss of 7,50,000 jobs that will result because of the sequester," said Representative Chris Van Hollen, the senior Democrat on the House Budget Committee.