WASHINGTON — Despite his image as a button-down Republican, House Speaker John Boehner walked to the brink of a dramatic and historic agreement to change the government’s spending habits. But as he twice approached a $4 trillion deficit-reduction deal with President Barack Obama that would have rocked both parties’ bases, Boehner was reeled back in by his caucus’ conservative wing. The muscular, tea party-fueled group not only forced him to abandon a “grand bargain” with Obama, it made him scramble Wednesday to secure the votes for a far more modest deficit-ceiling plan, which in turn is all but doomed in the Senate. The events highlight the limits of power for an experienced and well-liked politician who has struggled to budge his caucus’ staunchest conservatives despite constantly reminding them that their party doesn’t control the Senate or White House. “The problem with leadership is it has to be conjoined with follower-ship,” Duke University political scientist David Rohde said. “Boehner is not in a position to give orders to his members.” A grand bargain might have passed, with scores of Democratic votes replacing GOP dissenters, Rohde said. But it also could have put Boehner’s speakership in jeopardy. No matter how the White House and Congress handle next week’s expiration of the government’s borrowing power, the messy finish will make it easy to forget that Boehner and Obama once stood on the precipice of a daring compromise. While never completed, the general outlines would have cut spending by about $3 trillion over 10 years. It would have started reining in Medicare and Social Security benefits, and raised tax revenues by $800 billion or more. Both men knew the tax component would be the toughest sell for Boehner, whose party has raised the “no new taxes” mantra to near-religious status. In turn, however, liberals would have shrieked at Obama’s willingness to curb entitlement programs and severely trim other government programs, changes that Boehner could have touted as a remarkable GOP victory. “There was always a desire to go forward with as large a package as possible that would deal with the underlying structural challenges that face the entitlement systems,” a top House leadership aide told reporters at a Friday briefing after the deal collapsed. “We thought we could get to significant entitlement and tax changes.” Boehner, a mainstream conservative from Ohio, would have insisted that the changes were not “tax increases.” That’s a familiar semantics game in Washington. It would emphasize a freeze or even reduction in most tax rates while drawing attention away from an overall growth in tax revenues, thanks largely to eliminating loopholes and subsidies. The grand bargain would have been a heavy lift in both parties. Perhaps it never could have passed the Democrat-controlled Senate or GOP-controlled House. But administration and House insiders say Obama and Boehner came remarkably close to a handshake deal, even though neither man is reputed to be a great risk-taker. “The space between us had narrowed to very, very little,” a top White House official told reporters Friday. Both briefings Friday were conducted under ground rules that required the speakers to be anonymous. Boehner knows the tricks of passing bipartisan compromises, at least in the pre-tea party days. He collaborated in 2001 with liberal Sen. Ted Kennedy to pass President George W. Bush’s No Child Left Behind education bill. But the tea party movement has nurtured dozens of lawmakers who see compromise as suspect, if not downright cowardly. The growing prevalence of anti-tax pledges signed by GOP lawmakers also limits the speaker’s maneuvering room. Boehner “would have taken a big risk of being replaced as speaker even if the deal had gone through,” Emory University political scientist Alan Abramowitz said. Many lawmakers think Boehner would have lost more than 100 of his 240 Republican members if he had pushed the grand bargain. That probably would have prompted an overthrow attempt by at least one rival. By Wednesday, Boehner mixed threats and pleas in a meeting with his rank and file members, hoping to avoid an embarrassing defeat Thursday on his scaled-down debt-ceiling proposal. “Get your ass in line,” he told them, according to lawmakers and his spokesman, Mike Steel. “I can’t do this job unless you’re behind me.” Boehner, 61, grew up in a big Catholic family in a small house in Cincinnati. He worked his way through college and prospered at the head of a plastics packaging company before entering the House in 1991 as a self-styled reformer. He joined the “Gang of Seven” that insisted on naming all 355 members with overdrafts at the House bank, a damaging scandal during the 1990s. Boehner rose in the leadership ranks, fell from favor, and patiently rose again. He takes a milder approach to persuasion than famous arm-twisters such as former House Majority Leader Tom DeLay, R-Texas, but lawmakers say he can be persistent and tough when he wants something. Rohde sees parallels between Boehner’s ascension to the speakership this year and that of Newt Gingrich following the 1994 “Republican revolution.” Both men faced high expectations, but were largely thwarted by Democratic presidents. Gingrich initially had a higher level of trust from his party’s members, Rohde said, largely because he was the intellectual and spiritual leader of the 1994 overthrow of four decades of Democratic House rule. Boehner, by contrast, was mostly an observer of the tea party’s 2009-2010 uprising. “The tea party people don’t trust Boehner,” Rohde said. “They see him as part of the past.” There’s little love between the Boehner and Obama camps now. Obama’s campaign is sending emails asking supporters to call Boehner’s Capitol telephone number “and tell him we can’t afford to let politics hold our economy hostage.” Such appeals often jam congressional phone lines. Terry Holt, a Republican lobbyist and former Boehner aide, said the speaker has done an admirable job of negotiating for his party. “Boehner has brought them record spending cuts without any tax increases,” Holt said, “and the Republicans have fundamentally changed the conversation in Washington.” “Changing the conversation” is a far cry from slashing the deficit by $4 trillion over 10 years and revamping entitlement programs. But with a tea party wing yanking Boehner on the right, and a Democratic Senate yielding little ground on the left, it might be the best that an ambitious, big-dreaming speaker can do.