Republican House Speaker John Boehner announced Friday that he will step down from his post as the country’s No. 3 elected official and leave Congress entirely, effective Oct. 30. The Ohio lawmaker dropped his bombshell announcement one day after fulfilling his two-decade dream to host the pope at the Capitol.

The move sent ripples of shock through official Washington, where the timing of his decision surprised everyone from Boehner’s top deputy, Republican House Majority Leader Kevin McCarthy, of California, to President Obama. McCarthy was seen as the favorite to succeed Boehner, but likely faced a divisive leadership fight with the party’s more anti-establishment wing.

Boehner’s decision emerged one day after he hosted Pope Francis. The speaker, a lifelong Catholic, was visibly emotional throughout the visit, shedding tears during the pontiff’s address to a joint meeting of the Senate and House of Representatives, a first.

At a press conference that swung from jovial to tearful and back again, Boehner described his decision to bring the curtain down on a quarter-century in Congress as partly inspired by the pope, partly a spur-of-the moment call.

“This morning, I woke up and I said my prayers, as I always do, and I decided, ‘You know, today’s the day I’m going to do this,’” he told reporters. “As simple as that.”

It wasn’t quite that simple, though. Since virtually the moment the 65-year-old lawmaker first hefted the speaker’s gavel in early 2011, Boehner came under intense pressure from the conservative wing of his party to resist compromises with Democrats and to use spending bills as leverage for measures unacceptable to President Obama — risking a shutdown of the government.

That prospect loomed large over his announcement. A phalanx of conservatives have demanded that spending legislation for fiscal year 2016, which begins next Thursday, strip out funding for Planned Parenthood. Boehner’s decision means insurgent Republicans threatening to try to replace him have largely lost their leverage, while the speaker is freer to court Democratic votes to avert a shutdown.

Story continues

Yuri Gripa/Reuters

And there was the matter of his longtime rivalry with former Republican House Majority Leader Eric Cantor. Boehner said he had thought about resigning in 2014, but reversed course after Cantor’s shock defeat in his reelection primary. Facing another potential conservative insurrection, Boehner said he had concluded that a leadership fight now “would do irreparable harm to the institution.”

About who should be his successor, Boehner said he would not be around to vote. But he underlined that McCarthy “would make an excellent speaker.”

Asked whether the next speaker might inherit his same challenges, Boehner replied: “Hopefully not.”

“At the end of the day, the leaders will have to be able to work with each other, trust each other to find the common ground, and get things done,” he said. “If the Congress stays focused on what’s important to the American people, they’ll get along just fine.”

Obama, when asked about Boehner during a joint press conference with Chinese President Xi Jinping, declared: “It took me by surprise.”

The president said he had spoken by telephone earlier with his frequent antagonist and went on to praise him as a patriot and a man of his word. But Obama expressed pessimism about prospects for improved relations with his opposition in Congress.

“It’s not as if there’s been a multitude of areas where the house Republican caucus has sought cooperation previously. So I don’t necessarily think that there’s going to be a big shift,” he said in the Rose Garden. “But perhaps the visit by the Holy Father to Congress may have changed hearts and minds.”

The speaker of the House of Representatives, who is second in line for the presidency, enjoys vast powers to set his party’s legislative agenda and decide when certain bills get a vote. When speakers hail from the party that does not hold the White House, they also have an important role in shaping their party’s message to the voters.

Hardline conservatives in the House had long complained about Boehner’s pragmatic style, accusing him, in effect, of being overly accommodating to Obama.

Sen. Ted Cruz, the Texas Republican who has sometimes stoked conservative anger in the House, said at the conservative Values Voters Summit in Washington that the question of Boehner’s successor was up to the House.

But he quickly moved on to a lengthy critique of his speakership, blaming it for “volcanic” frustration among conservatives around the country.

Cruz, a contender for the 2016 Republican presidential nomination, said he had “long called on Republican leadership to do something unusual, which is lead — to actually stand up and honor the commitments that we made to the American people.”

“We’ve had Republican majorities in both houses of Congress for coming up on a year now. And what on earth have they done?” Cruz declared.

Conservatives literally cheered the news that Boehner would leave.

But McCarthy said in a statement, “It takes profound humility to step down from a position of power, and John’s depth of character is unmatched.”

McCarthy made no reference to seeking Boehner’s job, but emphasized that “now is the time for our conference to focus on healing and unifying to face the challenges ahead and always do what is best for the American people.”

Boehner also drew tributes from his counterpart in the Senate, Republican Majority Leader Mitch McConnell, as well as from regular antagonists like Democratic Senate Minority Leader Harry Reid, who seized the occasion to take shots at the GOP.

“It’s very, very sad that the tea party caucus that Republican leaders embraced to win in 2010 have now taken over control of the party,” he said.

Boehner, who made folksy banter a feature of his regular back-and-forths with reporters, had an easy answer when asked what he would miss.

“What will I miss? Of course all of you,” he said at his press conference, drawing laughter. “I don’t know what I’m going to miss because I haven’t missed it yet. But I’ll certainly miss the camaraderie of the House.”