This story was last updated at 2:43 p.m. ET.

House Speaker John Boehner will resign in October to the shock of almost everyone in Capitol Hill.

The news leaked Friday morning after Boehner made the surprise announcement in a GOP conference.

Speaker Boehner just announced in Conference that he will resign as Speaker and from Congress at the end of October. — Rep. Bill Huizenga (@RepHuizenga) September 25, 2015

After initially cancelling a press conference set for Friday morning, the speaker came forward later in the afternoon to give a public statement on his decision.

The decision was not as sudden for Boehner as it appeared to the public. He had initially to step down at the end of 2014, but changed that decision halfway through the year. The plan then became to leave at the end of 2015, but "it's become clear to me that this prolonged leadership turmoil would do irreparable harm to the institution," he said.

Boehner said he mentioned the potential decision to his wife on Thursday night. This morning, after he woke up and said his prayers, he made his decision. It was "as simple as that," he said.

President Barack Obama spoke positively of Boehner at a press conference on Friday, despite their policy disagreements. "He is a good man and a reasonable man and he is going to be around for a while," Obama said.

Nancy Pelosi, the House Minority Leader (D.-Calif.), was more critical in her response, particularly of the Republican party. She said Boehner's resignation was "seismic" for the House of Representatives and a "a stark indication of the disarray of House Republicans."

It is a "demonstration of their obsession with shutting down government at the expense of women's health and a sign of the failure of the House Republicans to be willing to engage in dialogue for the good of the American people," Pelosi added.

But Boehner's decision came as a surprise to many. Pelosi said she found out about his decision from her phone as screens lit up with the news.

"He didn't give anyone a heads up. This was a complete surprise to all of us," Rep. Darrell Issa (R-Calif.) told the Washington Post. The paper reported "a long period of applause" could be heard outside of the conference meeting room after the announcement was made.

Chaos and dysfunction in House GOP ranks finally takes its toll; Speaker Boehner is dethroned — Gerry Connolly (@GerryConnolly) September 25, 2015

Boehner's decision comes at a critical time for Congress as Sept. 30, the last day of the fiscal year and the deadline to avoid a government shutdown, draws closer.

Boehner had been engaged in legislative maneuvering in order to avoid another shutdown while also maintaining his hold on the speakership. On Thursday, Boehner met with members of the House Freedom Caucus, a conservative group that has been threatening to oust him.

South Carolina Rep. Mick Mulvaney said this week that if a vote were held now, he believed Boehner lacked adequate votes to hold the speakership. One aide told reporters that Boehner would rather step down or resign than "put members through prolonged leadership turmoil."

Boehner aide's full statement on impending resignation. Comes amid rumblings of conservative coup. pic.twitter.com/ZB3IY8xdbC — Benjy Sarlin (@BenjySarlin) September 25, 2015

Boehner's announcement is likely to set off fierce jockeying among Republicans vying to replace him as speaker; in the last election held in January, 25 Republicans dissented and voted against Boehner.

House Majority Leader Kevin McCarthy is viewed as a frontrunner for the job. "Kevin would make an excellent Speaker," Boehner said on Friday.

Among other Republicans getting support are Reps. Daniel Webster of Florida, Jim Jordan of Ohio, Louie Gohmert of Texas and Jeff Duncan of South Carolina; and Sens. Rand Paul of Kentucky and Jeff Sessions of Alabama. (Some have argued that the Constitution would permit a speaker of the House from outside the chamber.)

Boehner has been speaker since Jan. 5, 2011. Before that he served as House minority leader. He has represented Ohio's 8th congressional district since 1991.

On Thursday, Boehner fulfilled what was believed to be a lifelong dream by having a pope address Congress. He was seen tearing up as Pope Francis greeted the faithful from the Speaker's balcony at the U.S. Capitol.

Boehner teared up at Friday's press conference, but those may have been tears of joy, as he appeared relaxed and happy as he spoke with reporters.

via GIPHY

“I do know this. I’m doing this today for the right reasons and the right things will happen as a result,” he said.

via GIPHY