After the third round of White House talks in 24 hours with Speaker John A. Boehner and Harry Reid, the Senate majority leader, President Obama said that they had made progress and that he hoped a compromise could be reached early Friday.
“I’m not yet prepared to express wild optimism, but I think we are further along today than yesterday,” Mr. Obama said during a late-night appearance in the White House briefing room.
The two sides appeared to be only a few billion dollars apart on the level of spending to be approved for the balance of this year, a relatively small gap in a $3.5 trillion budget. Negotiations appeared to be hung up mostly over Republican demands to tighten restrictions on financing for abortions and to limit environmental regulations, and by Mr. Boehner’s desire to squeeze every dollar in cuts out of the Democrats that he could.
Mr. Boehner and Mr. Reid issued their own joint statement after the meeting on Thursday night, saying that they and their advisers would “continue to work through the night to attempt to resolve our remaining differences.” Negotiators went to work in the Capitol, though top aides expressed pessimism about a quick conclusion.
After the meeting, Mr. Obama canceled a planned trip to Indiana on Friday to participate in the final push to get an agreement.
Throughout the day, members of both parties played a game of chicken, seeking to force the other to give in as the deadline of midnight Friday approached. Mr. Boehner in particular faced a tricky calculation about how much he could compromise without losing support not just from his large contingent of Tea Party-inspired fiscal conservatives, but also from social conservatives who were eager for a victory on abortion and other issues.
As Mr. Reid returned from the White House and briefly took the Senate floor, he said that the issues dividing the Senate and House were “extremely narrow,” but that it was far from certain they could be worked out in time.
“I am not really confident, but I am very, very hopeful,” he said.
Given the uncertainty and the short time remaining, federal agencies prepared to furlough employees and cut off most services. Workers, contractors and consumers scrambled to understand how a shutdown would affect them, and Democrats warned of harm to the economy. The two parties also maneuvered to assign blame to each other in the event that no deal could be reached, and neither side was certain that it could predict the political repercussions of a shutdown.
The policy disputes involved a handful of provisions. One would greatly limit financing for Planned Parenthood and other family-planning providers, in the United States and overseas, and prevent the District of Columbia from using its tax dollars to help poor women pay for abortions.
Also at issue were measures that would restrict the regulatory powers of the Environmental Protection Agency, a favorite target of Republicans since they took over the House, by preventing the agency from enforcing significant portions of the Clean Air Act and regulating carbon emissions.
The parties continued to spar over spending levels as well. According to Congressional officials, Mr. Boehner had proposed $39 billion in cuts to the current year’s budget on Wednesday after his bid for $40 billion was rejected. Democrats took the new offer under review.
Top budget staff, after working through the night, returned Thursday morning with a proposed $34.5 billion in cuts, with $3 billion of that to come from the Pentagon.
Democrats said Mr. Boehner insisted that any deal also include some of so-called policy riders, which they argued injected conservative ideology into what should be a numbers battle.
“This is no longer about the budget deficit,” said Senator Richard J. Durbin of Illinois, the No. 2 Senate Democrat. “It’s about bumper stickers.”
Mr. Boehner rejected assertions by the top Democrats that the policy divide was all that was holding up a deal.
“There are a number of issues that are on the table, and any attempt to try to narrow this down to one or two just would not be accurate,” said Mr. Boehner.
He and others noted that attaching policy instructions to spending bills was a Congressional tradition embraced by both parties.
Despite Mr. Obama’s threat to veto the measure, the House passed a Republican plan that would keep federal agencies open another week, cut $12 billion in spending and provide the Pentagon with money through Sept. 30. Republicans hoped the legislation, which passed 247 to 181, would show that they had made a serious effort to avert a shutdown and leave Senate Democrats and the administration facing criticism for cutting off money to members of the military serving overseas.
“If you vote against this bill, you are voting against the troops who are engaged in three wars,” said Representative Harold Rogers, the Kentucky Republican who chairs the Appropriations Committee. Representative Kevin McCarthy of California, the No. 3 House Republican, said the veto threat was “shameful.”
Jay Carney, the White House press secretary, dismissed the stopgap bill and said a bipartisan deal on funding the government for the rest of this fiscal year remained in reach.
“We have been negotiating in good faith, and we have closed the gap,” Mr. Carney said. “The people expect us to get the deal done.”
With the prospect that much of the government would cease to operate after midnight on Friday, preparations for a shutdown began in earnest.
Federal agencies and Congressional offices began telling workers who would be considered essential — and should come to work — and who should stay home. Lawmakers and top aides were briefed on the finer points of a shutdown, some shaking their heads in dismay as they left the meetings.
Tensions escalated in the Senate and House chambers. House members hooted at party leaders on the floor as they tried to make the case for where their opponents had gone wrong.
Representative Steny H. Hoyer of Maryland, the No. 2 Democrat, objected to the one-week Republican financing bill and noted that Democrats had negotiated with former President George W. Bush rather than close the government when they split over spending on the Iraq war.
But Representative Eric Cantor, a Virginia Republican and the majority leader, said Democrats were to blame for the crisis because they failed last year to pass a budget or the annual spending bills.
“We don’t accept the status quo,” said Mr. Cantor, who announced that the House — which had been scheduled to adjourn for the weekend on Thursday — would stay in session. “We don’t want to bankrupt this nation.”
In the Senate, Democrats indicated they did not intend to bring the House-passed budget extension to a vote, drawing outrage from Republicans.
“Funding our troops is not a distraction,” said Senator John Cornyn, Republican of Texas. “It’s a responsibility.”
Helene Cooper, Michael D. Shear and Jennifer Steinhauer contributed reporting.