Ryan, who has had an often-strained relationship with Trump but helped the president achieve his biggest legislative victory in the form of major tax cuts in December, made the announcement on Wednesday, portraying it as a decision to spend more time with his family after serving two decades in the House.
His action sets up a distracting House leadership succession struggle while Republicans are trying to fend off Democratic efforts to seize control of Congress in the mid-term elections.
"You realize something when you take this job," said Ryan, who reluctantly agreed to become speaker in 2015. "It's a big job with a lot riding on you, and you feel it. But you also know that this is a job that does not last forever."