For months, House Speaker John A. Boehner (R-Ohio) has been urging President Obama to do the “big deal” on debt talks. Using his oft-repeated refrain in a mid-May television interview, Boehner summed up his message this way: “Come on, you and I, let’s lock arms and we’ll jump out of the boat together.”

Late Saturday, on the eve of a pivotal meeting on the potential blockbuster budget-and-tax deal, the GOP speaker got to the edge of the boat and decided that the water was too deep, too choppy.

Reaching Obama at Camp David by phone, Boehner informed the president that their impasse over taxes was irreconcilable. A tax increase as envisioned by Obama, approximately $800 billion out of a package that would save more than $4 trillion, would never be approved in the increasingly conservative House.

What began with the two men riding together in a golf cart for more than four hours during a round at Andrews Air Force Base ended three weeks later with them literally a few hundred miles apart and stuck in ideological gridlock. Instead of a grand bargain, Obama and Boehner are now struggling to find a palatable mix of smaller spending cuts and revenue increases that they can sell to lawmakers in their respective parties. Unless Congress acts to raise the $14.3 trillion legal limit on the debt, Treasury Secretary Timothy F. Geithner has said, the government will begin to default on its obligations after Aug. 2.

Obama and Boehner thought they had a chance to reach beyond the hyper-partisan politics of this era. Since mid-June, they have held several secret meetings at the White House and had numerous back-channel talks.

Far from becoming fast friends, the unlikely duo had instead come to see this as a rare moment that brought together their mutual interests, according to their friends and advisers. If only they could demonstrate leadership on what is arguably the most important political compromise of the past three decades, both could benefit, those friends and advisers said. Obama could recapture some of the independent voters who have drifted away from him over the past two years, and Boehner could show that his new GOP majority is trying to save, not destroy, popular entitlement programs.

With the bigger deal all but dead, Obama and Boehner have just days to persuade their cohorts to agree to a smaller plan so there is enough time to approve the legislation and avert default.

The two men were back at it Sunday evening, meeting for about 75 minutes in the White House Cabinet Room with other leaders. It is clear they won’t be locking arms together and jumping off a large boat, but both realize the federal government is on the verge of stumbling into another collapse of the financial markets. Any chance of averting that rests with them and their ability to find some compromise.

“John knows nothing’s going to get done without the president’s blessing, and the president knows he needs John to get anything done,” said Sen. Saxby Chambliss (R-Ga.), a close friend of Boehner’s who also served in the Senate with Obama.

This article is based on interviews with more than a dozen top aides, lawmakers and strategists who are close to Obama and Boehner. Most discussed the relationship of the two leaders on the condition of anonymity to talk freely about private interactions.

Inspired by big deals

Obama and Boehner hail from starkly different backgrounds. The president, 49, was raised mostly in Hawaii by a single mother and grandparents and attended the nation’s most elite schools before settling in Chicago as a community organizer and launching his political career. The speaker, 61, one of 12 children from a working-class town in Ohio, worked at his father’s neighborhood tavern, graduated from Xavier University and became the chief executive of Nucite Sales, a plastics manufacturer.

Both men think in broad themes — neither is fond of the gritty, line-by-line work of legislation. Both seek consensus in a way that is at odds with the bullying style of past presidents and congressional leaders, such as Lyndon B. Johnson and Tom DeLay.

Their inspiration for the big deal came from past big deals: the 1983 Social Security compromise between a Republican president (Ronald Reagan) and a Democratic speaker (Thomas P. “Tip” O’Neill), for instance, and the compromises on welfare and budgets between a Democratic president (Bill Clinton) and a Republican speaker (Newt Gingrich) in the mid-1990s.

Yet what Obama and Boehner were trying to accomplish was even more ambitious.

The first public display of their bond came June 18 when they played a full round of golf together. It was the first time the two leaders had met in a non-work setting. Paired together, Boehner and Obama beat Vice President Biden and Gov. John Kasich (R-Ohio) on the 18th hole. Acquaintances described the closely guarded outing as loose, with plenty of good-natured ribbing.

The outing served as a pivot point, according to administration and congressional officials. Immediately after, the duo decided to take over the negotiations themselves, leaving other congressional leaders — some of whom had spent six weeks in talks with Biden — wondering what the president and speaker were trying to hatch.

Even before the golf outing, Boehner had a couple of private phone conversations with the vice president. And as far back as mid-May, Biden had informed White House advisers Boehner that wanted a bigger deal than the $2.4 trillion in cuts that had emerged in the Biden talks, according to aides familiar with the discussion.

Four days after golfing, Boehner slipped into the White House residence on a Wednesday night for a meeting with Obama.

House Majority Leader Eric Cantor (R-Va.), a sometime rival of Boehner’s, learned about the impending White House visit from a side discussion with the vice president earlier that day, near the end of Biden’s debt talks in the Capitol, according to aides in both parties. With the group bogged down amid Democratic demands for tax increases and the Obama-Boehner talks already happening, Cantor pulled out of the Biden group the next day.

Over the Fourth of July weekend, Obama and Boehner held another clandestine meeting, a Sunday night discussion that some top advisers wouldn’t learn about for several days. As before, Boehner arrived alone, with no staff members, and the two men met in the White House residence. By Tuesday afternoon, Obama decided to go public, announcing he would bring congressional leaders to the White House and asking them to leave “ultimatums at the door.”

In that meeting with leaders Thursday, Obama pushed for the bigger deal and cited a favorite phrase of the vice president’s, according to a White House aide with knowledge of the meeting. “Don’t die on a small cross,” he told the lawmakers.

Negotiators were making progress throughout the week as the two sides passed back and forth various proposals, according to sources familiar with the talks who agreed to discuss them on the condition of anonymity. The speaker had even agreed not to press for a repeal of Obama’s landmark health-care law that Boehner had used so effectively against Democrats in the 2010 midterm elections that gave him the gavel.

No likely support

According to those familiar with the talks, Boehner and Obama needed to do a “temperature taking” of the likely support they would have among key constituencies in their respective parties.

House Minority Leader Nancy Pelosi (D-Calif.) had two key conditions in considering cuts to Social Security benefits: Any savings from those cuts would be returned to the trust funds that finance Social Security and Medicare, thereby extending their solvency. And in exchange for these cuts there would be higher taxes paid by the nation’s top income earners.

That last demand prompted a rebellion in Boehner’s leadership ranks. At a mid-week meeting with Boehner, Cantor and House Majority Whip Kevin McCarthy (R-Calif.), who is in charge of counting votes, spelled out their staunch opposition to a proposal that would allow the expiration of the George W. Bush-era tax cuts for those making more than $250,000. Cantor and McCarthy argued against what they called a “decoupling” of the middle-class cuts and those for the wealthy, according to a senior aide familiar with the discussion.

At Thursday’s White House meeting, Cantor made clear that the tax revenue package as envisioned could not pass the House, according to party officials.

McCarthy’s opposition was more significant. As the lead recruiter for candidates in 2010, he is a close ally of the critical bloc of 87 freshmen and understands their political pulse better than anyone at the leadership table. In recent days, McCarthy has emphasized a greater willingness to fight than to compromise. In a Sunday appearance on CNN’s “State of the Union,” he reiterated his call to approve a balanced-budget amendment as the solution to the nation’s debt crisis, a politically unrealistic possibility.

At a Friday morning news conference, Boehner joined members of his leadership team, one by one, as they all denounced any effort to raise taxes.

But Boehner’s camp believed a deal could still be made.His top aides had spent the days negotiating with the White House to secure some guarantee that the top income earners would allow for their taxes to be slashed during the proposed follow-up effort later this year to rewrite the tax code by wiping out billions of dollars in loopholes.

A final discussion came Friday in the Capitol with Boehner chief of staff Barry Jackson, top policy adviser Brett Loper and two key Obama aides, Jack Lew and Rob Nabors. They all sat around a table debating tax and entitlement issues. Democrats say the White House rejected Boehner’s last offer setting up the guarantee for lower rates for the rich, but Republicans say the White House team would not support deep enough cuts to Medicare.

The meeting broke with no resolution and, after they received an update Saturday on an entitlement estimate that wasn’t satisfactory, Boehner’s aides briefed him about the situation. He made the call to Obama on Saturday night, but Boehner’s own words and body language Friday summed up where things stood.

Looking glum, he held his arms far apart to demonstrate the distance between him and Obama — their arms weren’t locked, and they weren’t ready to jump off the boat.

“Look, I have wanted all through this process to do what I would describe as the big deal that would fundamentally solve our spending problem and debt problem in the near to medium term,” Boehner said. “But at the end of the day, we’ve got to have a bill that we can pass through the House and the Senate. This is a Rubik’s Cube that we haven’t quite worked out yet.”

Staff writers Lori Montgomery and Zachary A. Goldfarb contributed to this report.