The Wisconsin Republican cast the decision as a personal one, saying he did not want his children growing up with a "weekend dad." He told reporters he believes he's leaving with strong accomplishments his party can sell to voters ahead of November elections.
"I have given this job everything I have," he said. "We're going to have a great record to run on."
Ryan's plans have been the source of much speculation and will set off a scramble among his lieutenants to take the helm. A self-styled budget guru, Ryan had made tax cuts a centerpiece of his legislative agenda, and a personal cause, and Congress delivered on that late last year.
Ryan, who has had a difficult relationship with President Donald Trump, thanked the president for giving him the chance to move the GOP ahead.
Ryan, 48, announced his plans at a closed-door meeting of House Republicans Wednesday morning, according to those present. His tone was somber, and he read directly from prepared remarks.
"After nearly 20 years in the House, the speaker is proud of all that has been accomplished and is ready to devote more of his time to being a husband and a father," Ryan adviser Brendan Buck said in a statement. "While he did not seek the position, he told his colleagues that serving as speaker has been the professional honor of his life, and he thanked them for the trust they placed in him."
The speaker called extended family and a few close friends Tuesday night and alerted a few staff. On Wednesday morning, he called the president and the vice president and informed the rest of his staff before going to the conference meeting, officials said.
Ryan will serve out his term and retire in January, Buck said.
Ryan, a Republican from Janesville, Wisconsin, was first elected to Congress in 1998. Along with Reps. Eric Cantor and Kevin McCarthy, he branded himself a rising "Young Gun" in an aging party.
He became the GOP presidential nominee Mitt Romney's running mate in 2012.
Ryan was pulled into the leadership job by the abrupt retirement of House Speaker John Boehner in 2015. Boehner had struggled to wrangle the chamber's restless conservative wing and failed to the seal big-picture deals on fiscal policy he sought. Ryan had more trust with the hardliners in the House, but had no more success in brokering fundamental reform of entitlement he sought.
He ultimately had to wrestle with another unexpected challenge: President Donald Trump, a president with little of Ryan's interest in policy detail or ideological purity. The two have not had a close working relationship.
House Majority Leader McCarthy, a Republican from California known to be tighter with Trump, is expected to seeking the speaker post. He will likely compete with House Majority Whip Steve Scalise, of Louisiana, for the job. Both men spoke at the closed-door meeting Wednesday, delivering tributes to Ryan.
In Wisconsin, the most likely Republican candidate is state Assembly Speaker Robin Vos, multiple Republicans in the state said. Vos did not immediately return telephone or text messages.
Another Republican mentioned as a potential candidate is longtime Ryan family friend and Ryan backer Bryan Steil, an attorney and member of the University of Wisconsin Board of Regents. Steil did not immediately return an email seeking comment.
Democrat Randy Bryce, a colorful ironworker who has cultivated an "IronStache" moniker, had been Ryan's best-known challenger, drawing liberal support from around the country. He had nearly $2.3 million in the bank at the end of the first quarter. Janesville teacher Cathy Myers was also running on the Democratic side. The only declared Republican was Paul Nehlen, who was banned from Twitter for a series of posts criticized as racist or anti-Semitic.