Congressional negotiators raced against the clock Wednesday to reach a deal to fund the government for the rest of the year.

As Democrats and Republicans continued to bicker publicly over who is responsible for the weeks-long stalemate over the 2011 budget, senior aides to House Speaker John A. Boehner (R-Ohio) and Senate Majority Leader Harry M. Reid (D-Nev.) made progress in private talks, raising hopes for at least the broad outlines of a pact by week’s end.

The two leaders then spent nearly 90 minutes Wednesday night in the White House with President Obama, who told reporters in a very rare late-night briefing that progress was made but no deal was yet at hand.

“I remain confident that, if we are serious about getting something done, we should be able to complete a deal and get it passed and avert a shutdown,” Obama said. “But it’s going to require a sufficient sense of urgency from all parties involved.”

He also sounded a stern note about the consequences. “It would be inexcusable, given the relatively narrow differences when it comes to numbers between the two parties, that we can’t get this done,” Obama said. “There’s no reason why we should have a government shutdown unless we’ve made a decision that politics is more important.”

After trading public accusations earlier in the day, Boehner and Reid sounded a far more conciliatory tone Wednesday night. “I have confidence that we can get this done,” Reid said, adding that the group had “narrowed the issues significantly.”

Boehner, who has not made a joint appearance with Reid on a legislative matter in recent memory, agreed that “some progress” had been made and “there’s an intent on both sides . . . to work together to try to resolve this.”

But the speaker reiterated that there was “no agreement on a number, and there’s no agreement on the policy questions.” The leaders said their staffers would work through the night and they would resume negotiations Thursday.

Even if they do reach an agreement, both sides acknowledged that it may be all but impossible for the bill to make its way through the House and the Senate before midnight Friday, when Washington will effectively run out of money and the government is set to shut down.

To keep that from happening, House and Senate leaders would have to agree to yet another stopgap resolution to keep Washington open into next week.

At a meeting with fellow Republicans, Boehner announced that he will bring a one-week spending resolution to the House floor for a vote on Thursday. It calls for $12 billion in cuts and would fund the Pentagon for the rest of the year. Republicans rallied around the idea. The teary-eyed speaker received a standing ovation from GOP members, lawmakers said.

Even the most conservative lawmakers, led by Rep. Mike Pence (R-Ind.), vowed to support what they called the “troop funding” measure, and Boehner’s closest allies grew confident that the good spirits would carry over to a compromise plan on a full-year measure, particularly after the release Tuesday of a 2012 budget proposal designed to save trillions, not billions, of dollars.

“I think there’s a transformational moment here recognizing that big gains come with the budget which we’re marking up, and I think that’s shifted an attitude to say it’s time to move beyond $10 billion, $11 billion, $3 billion, $60 billion, whatever. We’ve got trillions we need to deal with to get this country on firm footing,” said Rep. Greg Walden (Ore.), a member of the vote-counting team of Republican whips.

Senate Democrats dismissed Boehner’s one-week proposal — which also contains an unrelated provision to ban federal and local government funding for abortions in the District — as a political maneuver: Democrats will certainly vote against it, allowing the GOP to blame them if the government shuts down.

“We’ve been more than reasonable, more than fair,” Reid said in a speech Wednesday evening on the Senate floor. He suggested that it was Boehner who was afraid to cut a deal.

“All they would have to do is say yes,” Reid said.

Before this week, Obama largely distanced himself from the spending talks. He routinely mocks Congress as a group of children — a line that works with crowds outside Washington but irritates Democrats and Republicans alike inside the Capitol.

Obama’s remarks late Wednesday completed a highly unusual day in which he left town for campaign-style events, believing that the two sides were coming together, only to call Reid and Boehner to the White House for a meeting that would start minutes after he returned from New York.

“You want everybody to act like adults, quit playing games, realize that it’s not just my way or the highway,” he said in a speech Wednesday afternoon in Fairless Hills, Pa., outside Philadelphia. “How many folks are married here? When was the last time you just got your way? I mean, that’s not how it works.”

The president and Democrats argue that the two parties first need to agree on the details of a budget deal. If that happens, they say, both Democrats and Republicans will have an incentive to compromise on a short-term resolution to keep the government open.

As the leaders traded insults, their aides focused on trying to extract as much as $40 billion from the 2011 budget, according to aides in both parties, who spoke on the condition of anonymity to discuss the private talks.

Congressional staffers involved in the negotiations have compiled an array of possible cuts. They are ready to assemble a final spending plan if Boehner and Reid instruct them to do so.

Once such a bill is drafted, Boehner’s biggest task would be selling it to his fellow Republicans.

Some members of the most critical bloc of conservative Republicans — the 87 freshmen — have signaled that they might be willing to compromise on a 2011 spending plan in order to move on to bigger issues, including the 2012 budget proposal that GOP House leaders announced Tuesday. A vote on that bill could come next week, but Boehner first wants to end the dispute over this year’s funding plan.

“I think we need to get this behind us,” said freshman Rep. Robert T. Schilling (R-Ill.). “Right now we need to keep the government open, make sure the military are taken care of, and then move on to the debt ceiling and everything else.”

While a potentially decisive group of Democrats appears willing to support the emerging 2011 spending plan, Boehner has sought to draw as much support as possible from within his own caucus. He spent the past week denying claims from Vice President Biden and Reid that he had agreed to $33 billion in cuts. Instead, he floated $40 billion as an acceptable number.

Negotiators reported strong progress Wednesday but were still trying to work out what to cut and by how much.

The two sides have already approved $10 billion in reductions, and Democrats have identified about $13 billion more, aides said. The biggest sticking point: Democrats have demanded that some of the cuts come from one-year reductions in such programs as Pell grants and farm subsidies. Republicans have resisted because such cuts would not permanently reduce the size of the government.

To reach his new request for $40 billion in cuts, however, Boehner will eventually have to go along with at least some one-time reductions, aides from both parties said.

Read more on PostPolitics, and follow us on Facebook and Twitter.

Get the latest news and updates on the budget impasse. Click here to sign up for the newsletter.

Bacon reported from New York and Washington.