WASHINGTON — At one crucial moment in the game of chicken over a looming shutdown of the United States government, President Obama and the House speaker, John A. Boehner, faced off in the Oval Office. Mr. Boehner, a Republican heavily outnumbered in the room by Democrats, was demanding a provision to restrict financing to Planned Parenthood and other groups that provide abortions. Mr. Obama would not budge.

“Nope. Zero,” the president said to the speaker. Mr. Boehner tried again. “Nope. Zero,” Mr. Obama repeated. “John, this is it.” A long silence followed, said one participant in the meeting. “It was just like an awkward, ‘O.K., well, what do you do now?’ ”

That meeting broke without an agreement. But while Mr. Obama may have held tough on the abortion provision, he and the Senate majority leader, Harry Reid, had already made a broader concession — agreeing to tens of billions of dollars in spending cuts that would have been unthinkable had Republicans not captured control of the House from Democrats in midterm elections last year.

For Mr. Boehner, the deal represents an early showcase of negotiating prowess, and an ability to balance the clamor of staunch conservatives in his party, who have little desire to compromise with Democrats, with the political imperative of securing real accomplishments. Even some Democrats said that in a deeply divided Washington, Mr. Boehner’s negotiations over this past chaotic week harked back to a time when party leaders were more willing to give ground and do business with each other.