Two hours before the federal government would screech to a midnight halt, House Speaker John A. Boehner, a onetime Cincinnati plastics salesman, faced a restless group of Republican lawmakers.
The Republican leader did not have the news they wanted: a budget deal.
But Boehner went into the Friday night meeting anyway. He talked for 45 minutes, building the case for compromise. And just when some in the Capitol basement conference room were starting to wonder, an aide slipped into the room. He nodded to the speaker.
"We have a deal," Boehner said. Cheers erupted.
His salesman's calm showed Boehner as an effective negotiator in the midst of rising anxiety over a federal government shutdown.
On both ends of Washington's power corridor, leaders had dug in for a negotiation they knew would go down to the wire as Republicans tried to get a package of steep cuts and policy goals, while Democrats tried to hold the line against a GOP empowered by its 2010 midterm election triumph.
Tempers erupted, and at times key figures doubted they could reach a deal. "Tea party" activists protesting outside the Capitol chanted, "Cut it or shut it."
But amid tension and public name-calling, Boehner and Senate Majority Leader Harry Reid (D-Nev.) at times worked to win each other's confidence, according to descriptions of the talks provided by key aides on condition of anonymity.
That process began on a Thursday in March after the House passed HR-1, an ambitious package of $61 billion in spending cuts. Democrats, who controlled the Senate, would never agree to such reductions.
Reid concluded that Boehner would need help persuading his members to compromise. One way to do that: have the Senate reject the House bill to show that another offer would be needed.
"I'll tell you what," Reid said. "I'll take up HR-1 for a vote."
Boehner appeared relieved. Obama later called Boehner and thanked him for that meeting.
But nearly a month passed before Obama called Boehner again — six days before the deadline for another possible shutdown.
The president summoned all sides to a Tuesday morning meeting at the White House. Boehner, outmanned by Democrats at the meeting, made the decision to up the ante.
His demand: $40 billion in cuts — $7 billion more than Democrats had on the table at the time.
The next day, a buoyant Boehner met with fellow Republicans behind closed doors. He told them about the higher offer, and said he had them to thank for supporting him in the move.
His eyes filled with tears.
The next day, Wednesday, was a brutal day of rhetoric in Congress. Conservative protestors outside the Capitol again called for a government shutdown. Obama convened the parties, late at night.
Boehner had not agreed to a number, and pushed for Republican policy provisions. Boehner, Reid and Obama sat down to hash out disputes over abortion, environmental regulation and healthcare. But the list was long, and there was only one copy.
An aide stepped into the West Wing to make photocopies. Minutes ticked away. Boehner deadpanned that the White House needed to "find a faster copy machine."
Obama picked up on the levity. The president pantomimed turning a crank, saying the White House had only an old mimeograph machine. After some laughter, the copies arrived and they went through the policy disputes, line by line.
The next day, Obama met with senior aides and asked them to explain the White House position, but not "say anything inflammatory," one senior aide recalled. "Don't say anything that makes it harder to get a deal," Obama told his staff.
That night, Boehner and Reid returned to the White House. All eyes were on the clock.
Line by line, they resolved most of the thorny policy issues sought by conservatives. But the abortion provision remained.
Obama would not budge on that measure. "That was our line in the sand," said an aide.
Boehner, too, dug in his heels. After a long go-around, the stalemate was wearing nerves as they discussed riders — provisions attached to the budget bill. Biden had had enough. After listening quietly to the discussion, he blew up.
"If it's going to be about riders, let's take it to the American people," Biden said.
Still, the parties ended the meeting Thursday with a loose agreement on the size of the package and the resolution of most policy provisions. Still hedging, Boehner asked to sleep on it. Meanwhile, aides worked through the night on the specifics.
But the details proved elusive, and aides hit an impasse around 3 a.m. One emailed Reid to tell him things did not look good.
"We thought we were wasting our time," an aide said.
Friday morning, as the nation became absorbed with the real possibility of a shutdown — troops going without pay, workers furloughed, markets shaken — Obama called Boehner again.
"I'm the president of the United States; you're the speaker of the House. We are the two most consequential leaders in the United States government," the president said. "If we have any hope of keeping government open from this point forward what we talked about last night has to be reflected in the negotiations."
Reid and Obama talked constantly throughout the day, sometimes every two to three minutes. Even as Boehner and Reid traded fiery statements before reporters, the mood in the capital shifted as word spread that negotiations were back on track.
A final number of budget cuts was in hand by 8 p.m., four hours before the midnight shutdown deadline. And aides still had to crunch the numbers.
At 10 p.m., Republicans were unhappy with the details and sought another round of negotiations. One aide, a Democrat working for Senate Appropriations Committee, looked at the clock.
"Look at the time," the aide told them. "It's now or never, folks."
The negotiators for the speaker, the Senate majority leader and the White House shook hands on the deal. Time: 10:30 p.m.
Cellphones started to ring. Obama and Reid were calling, aides said, to find out "what the hell was going on."
That's when a Boehner aide rushed to the Capitol basement and nodded to his boss. Then came Boehner's announcement, and the cheers.
Later, after delivering a speech in the White House Blue Room announcing the agreement, Obama met one of his chief negotiators, budget director Jacob Lew, in the State Dining Room.
The two men hugged.
Staff writer Christi Parsons contributed to this report.