UPDATE 5-Top U.S. lawmaker Ryan to retire in latest Washington upheaval

(Recasts first paragraph, adds quotes from Ryan, Trump, Ryan fundraising, details on speakership and possible replacement)

WASHINGTON, April 11 (Reuters) - U.S. House of Representatives Speaker Paul Ryan will not seek re-election and will leave his post at the start of 2019, further unsettling a Republican Party rocked by Donald Trump's tumultuous presidency ahead of November's pivotal congressional elections.

Ryan, who has had an often-strained relationship with Trump, made the announcement on Wednesday, portraying it as a decision to spend more time with his family. His action sets up a distracting House leadership succession struggle at a time when 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," Ryan, his party's failed 2012 vice presidential nominee who reluctantly agreed to become speaker in 2015, told a news conference. "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."

Asked how much Trump and his conduct in office influenced his decision not to seek re-election for his seat representing a district in southeastern Wisconsin, Ryan told reporters, "Not at all."

Ryan's announcement marked the latest upheaval in Washington in the second year of Trump's presidency, following the firings and resignations of a series of senior White House officials and Cabinet members.

"Speaker Paul Ryan is a truly good man, and while he will not be seeking re-election, he will leave a legacy of achievement that nobody can question. We are with you Paul!" Trump wrote on Twitter.

Ryan, 48, cited as his biggest accomplishment the Republican tax overhaul passed by Congress and signed by Trump in December. While Ryan cultivated a reputation as a fiscal conservative, the tax bill is forecast to balloon the federal deficit in the coming years.

Ryan became speaker in late 2015 after fellow Republican John Boehner quit following clashes with right-wing lawmakers in the divided party.

Among names already circulating as a possible Ryan replacement were House Majority Leader Kevin McCarthy of California and House Majority Whip Steve Scalise of Louisiana, who was wounded by a gunman last year. Trump has praised McCarthy and Scalise in the past.

Ryan in 2016 initially hesitated to endorse Trump after it became clear the wealthy New York real estate developer would become the party's presidential nominee, but eventually did so.

He also voiced unease at candidate Trump's call for banning the entry of Muslims into the United States and his criticism of a Mexican-American U.S. judge. A month before the 2016 election, Ryan said he was "sickened" by Trump's remarks about groping women captured on an audio tape recorded in 2005.

After Trump became president in January 2017, Ryan often expressed annoyance at being asked to respond to various incendiary Twitter messages from the president but rarely offered direct criticism.

Ryan was criticized by Democrats for what they saw as his failure to stand up to Trump and firmly confront the president on matters such as Trump's frequent attacks on U.S. law enforcement and the president's alienation of U.S. allies and abandonment of longstanding Republican principles like free trade.

ENTITLEMENT REFORM

Ryan said he regretted not being able to accomplish what he called entitlement reform, which could involve scaling back government spending on social safety net programs such as the Social Security retirement program and the Medicare and Medicare programs that provide health insurance for the elderly, poor and disabled.

Mark Meadows, head of the conservative House Freedom Caucus that played a key role in Boehner's departure, was asked by reporters if he had been approached about becoming speaker. He said, "It's way too early for any of that."

"At this point there has been zero consideration" of becoming speaker, Meadows said.

In stepping down, Ryan may have boosted Democrats' prospects in November, as some political analysts see a competitive race for his seat.

The move also triggered speculation that Ryan could be positioning himself for a race against Vice President Mike Pence for the Republican presidential nomination in 2020, if Trump is so badly damaged by then that he decides not to run for re-election. A source close to Ryan said this was not true, however.

The House speaker is second in the line of presidential succession, after the vice president.

Ryan, a prolific fundraiser for the party, raised $11 million in the first quarter of 2018 to bring his total for the current election cycle to $54 million. Of that, his campaign transferred $40 million to the National Republican Campaign Committee (NRCC), the arm of the party responsible for helping elect Republicans to the House.

Without his own campaign to run, Ryan could transfer all his remaining cash to the NRCC or other vulnerable Republicans.

Democrats need to pick up at least 23 seats in the 435-member House to regain the majority. Another Republican congressman, Dennis Ross of Florida, also announced on Friday he will not seek re-election in November.

(Additional reporting by Steve Holland, Ginger Gibson, Doina Chiacu, Susan Heavey; Editing by Kevin Drawbaugh and Will Dunham)