House Speaker John A. Boehner (R-Ohio) resigned Friday and said he feels like he is doing the right thing for the right reasons. (Reuters)

John A. Boehner never landed the really big deal he craved. Not the $4 trillion tax-and-entitlement deal he reached for in 2011, not the repackaged version a year later and not the immigration overhaul he sought in 2014.

He most clearly learned the limits of his power midway through his nearly five-year tenure as House speaker when he scaled down his ambitions for “Plan B” — a tactical gambit aimed at forcing Democrats to preserve Republican tax cuts. Conservatives rebelled because those making more than $1 million would have faced tax increases, and Boehner (Ohio) was left reading the “Serenity Prayer” to his Republican colleagues.

“God, grant me the serenity to accept the things I cannot change,” the speaker said.

That utter defeat left him unable to “go big,” as he liked to say, his effort to find a legacy-defining piece of legislation coming largely to a close. In the three years since, he mostly has been treading water.

This month, Boehner found himself in much the same position as before. But conservatives weren’t revolting over tax cuts or a farm bill or health-care legislation. This time, they were after his job.

On Friday, he decided to spare his party another fight, particularly one that was all about him. In the same basement room where he abandoned “Plan B,” he announced his resignation, ending a run as speaker that came to be defined by internal revolts and missed opportunities.

On Sept. 17, Republicans swore in their 247th member, giving them their largest House majority since 1930. Yet Boehner could never please his most conservative members. Fiscal deals negotiated with President Obama produced more than $2 trillion in savings and made the GOP’s tax cuts permanent for 99 percent of workers, but the far right painted both deals as sellouts.

Despite his early years as an agitator, Boehner never overcame the image that the conservatives saw: a country club Republican who loved to play 18 holes of golf and drink merlot afterward while cutting deals. In an era of shouting and confrontation, on talk radio or cable TV, Boehner’s easygoing style did not fit.

“John was fighting the 21st-century battles with 1990s tools, and you can’t just do that with a president of either party who is willing to push the envelopes of executive power,” Rep. Mick Mulvaney (R-S.C.), one of the lead rebels, said after Boehner’s surprise announcement Friday morning.

Aside from a Quixotic effort to cajole support for immigration legislation, Boehner has been stuck with a caucus bitterly divided between those willing to accept incremental progress toward conservative goals and those, like Mulvaney, willing to blow up the normal courtesies and practices in Washington.

“It’s like the Marine Corps: You spend 90 percent of your time on 10 percent of your guys,” Rep. Duncan D. Hunter (R-Calif.), an Iraq war veteran who still serves in the Marine Corps Reserve, said Friday. “I think that’s what ended up happening with Boehner toward the end, the last year or two. There was so much time dealing with fractious stuff inside the conference that it took a lot of time away from doing other things.”

As John Boehner resigns from Congress, one of his most memorable traits will perhaps be his frequent tears. Here's a look back at some of the occasions Boehner found himself full of emotion. (The Washington Post)

Boehner decided to retire, effective Oct. 30, after his emotional reaction to Pope Francis’s visit on Thursday to the Capitol. The speaker spent the night at an Italian restaurant on Barracks Row with close friends and then Friday morning at his regular diner two blocks from the Capitol, where he affirmed his decision.

It was a long fall from September 2010, when Boehner and his leadership team introduced the “Pledge to America,” their governing document touted in the final days of the midterm election campaign that delivered a Republican House majority.

That 2010 class — 87 Republicans strong — ushered Boehner into the speaker’s chair but brought with it dozens of lawmakers from deeply conservative districts that distrusted all of Washington, Republicans and Democrats alike. Dozens of the freshmen became loyal foot soldiers to leadership, but they also feared that their biggest political risk would come in a Republican primary, not from a Democrat in a general election.

That meant that when the most conservative members aligned themselves with outside conservative groups pushing for a harder line, these more moderate Republicans sometimes bucked Boehner out of fear.

The first warning sign for the new speaker came within weeks of him taking over, when Rep. Paul Ryan (R-Wis.), the fiscal expert for the caucus, presented a proposal for cutting about $40 billion from the 2012 federal agency budgets. The freshmen revolted, citing the “Pledge to America” and its call for $100 billion in cuts. Never mind that the fiscal year was half over; they wanted deeper reductions.

Boehner gave in, sending his troops back to draw up greater cuts to appease the right flank.

That scenario played out repeatedly throughout his term, most dramatically in the summer of 2011 when Boehner and Obama — after a much-hyped round of golf at Joint Base Andrews in Maryland — entered into negotiations aimed at a $4 trillion fiscal package of spending cuts and entitlement reforms.

Some called it the “grand bargain,” but Boehner called it the “big deal.” During one bargaining session in the White House Cabinet Room, he grew frustrated about the inability to reach an agreement, as Obama sat to his left and his deputy, then-Rep. Eric Cantor (R-Va.), was on his right.

“I didn’t want this job to have a big title. I want to do big things,” Boehner told the group, according to a Democrat in the room.

But as the talks grew close, Boehner balked at a demand from Obama for more than $1 trillion in tax increases.

The two leaders traded blame in dueling news conferences. As often happened, the Senate Republican leader, Mitch McConnell (Ky.), stepped into the breach to reach a compromise that left conservatives griping.

The pattern repeated with more negotiations and retreats later that year and, after another McConnell-brokered compromise passed in late 2012, the new Congress was sworn in. A ragtag group of Republicans moved to deny Boehner the speaker’s gavel for a second term — the first of what would become effectively three coup attempts against him.

With Democrats voting for their leader, Rep. Nancy Pelosi (Calif.), the conservatives tried to get enough Republicans to deny Boehner the majority. They had no alternative, no real plan, and it fell apart after several members prayed on whether to spare Boehner.

“Gone are the days when the leaders decide what the conference is going to do,” Rep. Lynn Jenkins (Kan.), who has been a low-level member of GOP leadership, said in the spring of 2013.

Boehner thought of retiring at the end of 2014, but Cantor lost in a stunning upset to a conservative who has linked arms with others against Boehner. With no heir apparent, he soldiered on through another coup attempt during a speaker vote in January and, as he said Friday, he had decided privately to retire at the end of this year.

But those botched coup attempts also sowed the seeds of an idea that would haunt him: that if they ever got enough rebels together, they could force a vote to deny him a majority from the Republican side of the aisle.

No speaker had ever lost his gavel under such a scenario, and his friends said that Boehner never wanted to rely on Democratic votes to keep the job. As a fight unfolded over the past two months about federal funding for Planned Parenthood, it became clear that 30 or more Republicans may have been willing to oust him if he extended government funding without a fight over the group.

The institution would endure a grueling ballot, and members he liked would have to take tough votes on Boehner’s behalf. So on Friday morning, a day after ­Francis’s address to a joint meeting of Congress, in the same room where his other fights ended, Boehner turned to the “Prayer of Saint Francis” to announce his retirement.

“For it is in giving that we receive; it is in pardoning that we are pardoned; and it is in dying that we are born to eternal life,” he said.