WASHINGTON House Speaker John A. Boehner plans to step down from his post and leave Congress at the end of October, an aide said Friday.

Boehner, who rose in 2011 to the job he said he had always wanted, never quite matched the new generation of tea party conservatives who swept Republicans to the majority during President Barack Obama's first term.

An affable deal-maker, the Ohio Republican struggled to control an unruly majority as Congress careened from crisis to crisis. He was often unable to corral enough votes to pass bills, forcing him to instead rely on Democrats _ which only weakened his standing among his troops.

Another crisis looms next week with a possible partial shutdown of the federal government. Conservatives have warned Boehner against making another compromise with Obama on the issue, and threatened a floor vote over his speakership.

Boehner has faced coup attempts before, but they fizzled as his conservative opponents failed to unite behind a new leader. Party leaders had vowed publicly to stand by Boehner, but sources said that many of them have been quietly assessing their options.

House Majority Leader Kevin McCarthy of California is next in line for the speaker's job. McCarthy, who is more conservative than Boehner, is popular among his fellow Republicans.

The announcement caps an emotional week for Boehner, who turns 66 in November and has served a quarter of a century in Congress. At Boehner's invitation, Pope Francis addressed lawmakers in a joint meeting of Congress on Thursday.

Boehner, a Catholic who was an altar boy and attended a Jesuit college, Xavier University in Cincinnati, had written such invitations to every pope while he was speaker, but Francis was the first to accept _ making history as the first pontiff to address the lawmakers.

"Boehner believes that the first job of any speaker is to protect this institution and, as we saw yesterday with the Holy Father, it is the one thing that unites and inspires us all," said the Boehner aide, who would not be named ahead of Boehner's announcement, expected later Friday.

Boehner stunned lawmakers assembled for a morning meeting in the Capitol basement.

"This was a pure act of selflessness," said Rep. Paul Ryan of Wisconsin, the party's vice presidential nominee in 2012 and a conservative favorite. "This was pure leadership."

Ryan said he would not run for the speaker's post.