As he announced his exit from public life, House Speaker Paul D. Ryan tried hard to show appreciation for the man who took the Republican Party from his grasp and transformed it into something else.

“I’m grateful to the president,” Ryan (R-Wis.) said four times in two minutes, with slight grammatical variations, in a news conference Wednesday at the U.S. Capitol, noting that Donald Trump’s 2016 victory gave Republicans the power to cut taxes and increase military spending.

But the praise did little to remove the shadow Trump casts over the end of Ryan’s career now that he has decided to forgo a campaign for reelection. The Trumpian revolution, which Ryan had long resisted, appeared to have claimed another victory, dispatching another occasional critic and reaffirming the president’s growing hold on a shrinking electoral coalition.

“Speaker Ryan is an embodiment of a particular kind of optimistic, pro-growth, pro-free market inclusive conservatism,” said Michael Steel, a former top adviser to House Speaker John A. Boehner (R-Ohio). “And that is a very different feel and tone of where the party is going under President Trump.”

Ryan’s decision to abruptly throw in the towel, about six months before the midterms, is likely to only further Trump’s control of the party. Republican strategists worry it will also make it harder for the GOP to hold onto the House, a prospect that seems less likely after a recent Democratic victory in a special election outside of Pittsburgh.

Not only are donors making clear they are more skeptical of the effort to retain the House, but the sudden departure of Ryan suggests the Republican ideological tent will continue to shrink. Including Ryan and Rep. Dennis A. Ross (R-Fla.), who also announced his retirement Wednesday, 46 Republicans have retired or said they will not run for reelection, and those ranks are likely to grow further in the coming weeks.

A former vice-presidential nominee, the highest-ranking Republican during Trump’s rise and once his party’s ideological standard-bearer, Ryan has spent the past two years resisting, minimizing and ultimately conceding to a Trumpian revolution he could neither contain nor control.

Ryan’s brand of politics, an uplifting fiscal conservatism rooted in his admiration of his former boss, Jack Kemp, seemed ascendant as recently as 2012, when Mitt Romney chose to add him to the presidential ticket. Four years later, as Trump was gaining popularity, Ryan warned the country of the divisive tactics the president continues to employ.

“Instead of playing to your anxieties, we can appeal to your aspirations. Instead of playing the identity politics of ‘our base’ and ‘their base,’ we unite people around ideas and principles,” Ryan said in a March 2016 speech on the state of American politics. “We don’t resort to scaring you; we dare to inspire you.”

But Trump still won, not just the nomination but the White House, with a campaign that cast immigrants as inherently devious snakes and encouraged public displays of anger at protesters and the press.

The protests Ryan offered rarely had an impact. He denounced Trump’s comments about a federal judge as “racist,” condemned Trump’s approach to trade, defended immigration as “a thing to celebrate,” and continued to fight for reductions in entitlement spending long after Trump promised no cuts to Medicare and Social Security. As recently as January, Ryan described Trump’s vulgar description of some majority-minority nations as “very unfortunate” and “unhelpful.”

But throughout it all, Trump’s power within the party continued to grow, as Ryan’s waned. National polls show Trump enjoys dominant approval ratings among Republicans, with 85 percent of party voters supporting the president in the latest Quinnipiac Poll, a dramatic increase from his position before the 2016 elections.

“Republicans have united around him and his agenda at least up to this point,” said Whit Ayres, a Republican pollster. “If you look at positions that Republicans as a whole have taken in the Trump era, positions they held as recently as two years ago no longer hold the same popularity.”

Polls have shown increasing Republican support for expanding Social Security, a position closer to Trump than Ryan, as well as declining Republican support for free-trade agreements, which were once a cornerstone of conservative economic thinking.

At the same time, Ryan has struggled to hold together a fractious GOP caucus, initially failing in his attempt to pass a repeal of President Barack Obama’s health-care law. Ryan’s favorability among Republican voters hovers around 7 in 10 , and his overall favorability rating is about even with that of House Minority Leader Nancy Pelosi (D-Calif.) in one poll, but he has higher favorability than her in some others .

Democrats began to evoke Ryan in campaign spots, seeing him as an easier target than Trump in some districts. “Paul Ryan is the single least popular political leader in the country,” said Jeb Fain, a spokesman for the Democratic-supporting House Majority PAC, before Ryan announced his retirement. “Across demographics and districts, Ryan’s less popular than Trump, and it comes down to policy.”

In recent months, Ryan has generally been more frank about the tensions of his job in private. At a donor retreat last week in Austin, Ryan interviewed White House Chief of Staff John F. Kelly before a group of donors, according to a person who attended the event. At points, they seemed to be commiserating about the difficulty of working in the current political environment.

“The speaker and the chief of staff both talked like they had left office,” said one donor who attended the event, speaking on the condition of anonymity because the proceedings were private. “The speaker thanked the chief of staff for being one of the sane guys in office.” At another point, this person said, Kelly said that when he gets an outside-the-box request from the president likely to cause concern on Capitol Hill, the first person he calls is “Paul or Mitch,” a reference to Ryan and Senate Majority Leader Mitch McConnell (R-Ky.), to ensure they are ­informed.

House Republicans will also be forced to debate Ryan’s replacement as their leader, even as they run for reelection. “This move by Ryan will set off an intramural food fight and take all eyes off the endgame of maintaining a pro-growth majority,” said Scott Reed, a political strategist at the U.S. Chamber of Commerce, who is planning millions in spending to defend Republican control in the House and Senate.

Corry Bliss, who runs the Congressional Leadership Fund, an outside group focused on keeping Republican control of the House, said Ryan told him he’ll keep raising money and will actually have more time now to do so.

“Paul Ryan’s commitment to protecting the House majority is greater today than it was yesterday,” Bliss said. “He told me personally that he’ll do whatever it takes to help CLF protect the Republican majority.”

For his part, Ryan maintained Wednesday that his departure would have no impact on the 2018 landscape. “I really don’t think a person’s race for Congress is going to hinge on whether Paul Ryan is speaker or not,” Ryan said. “So I really don’t think it affects it.”

It was an optimistic projection for a man who struggled to make his mark with an optimistic vision for the country.

David Weigel, Emily Guskin and Ashley Parker contributed to this report.