He used to be the future of the Republican party. On Wednesday Paul Ryan, seen by critics as an arch enabler of Donald Trump, left the political stage at the grand old age of 48.

US government shutdown: what is it, will it happen and who's to blame? Read more

Ryan, the outgoing House speaker, delivered a farewell address in the great hall of the Library of Congress, surrounded by white marble arches, stucco decoration and a high ceiling of painted panels, gold ornaments and stained glass. High above his head was the maxim: “The history of the world is the biography of great men.”

Ryan, Mitt Romney’s running mate for president in 2012, was seen as a small government policy wonk and rising star of the Republican party. But then came Trump’s hostile takeover. At first, Ryan offered resistance, describing the then presidential nominee’s criticism of a federal judge because of his Mexican heritage as “the textbook definition of a racist comment”.

But like most other Republicans, when Trump steamrollered his way to the White House, Ryan learned how to bite his lip and look the other way. He paid the price last month when the Republican majority in the House of Representatives was swept away by a blue wave of Democrats led by Nancy Pelosi, who is set to regain the speakership.

Their victory followed a campaign in which they attacked Republicans, led by Ryan, for trying to repeal and replace Barack Obama’s signature healthcare law.

Wednesday’s farewell after three years as speaker was effectively a concession speech not only to Pelosi but Trump, who owns the Republican party now, sending Ryan’s brand of conservatism into retreat. The Wisconsin congressman, who served for two decades, did not mention the president by name but offered some coded criticism.

Flanked by the stars and stripes, with busts of George Washington and Thomas Jefferson looking on, Ryan did deliver a warning about America’s “broken politics”. He said: “Today, too often, genuine disagreement quickly gives way to intense distrust. We spend far more time trying to convict one another than we do developing our own convictions.

“Being against someone has more currency than being for anything. Each of us has found ourselves operating on the wrong side of this equation from time to time. All of this gets amplified by technology, with an incentive structure that preys on people’s fears, and algorithms that play on anger. Outrage is a brand.”

Facebook Twitter Pinterest Ryan said: ‘Today, too often, genuine disagreement quickly gives way to intense distrust.’ Photograph: Chip Somodevilla/Getty Images

The outrage gets marketed and industrialised, resulting in less passion and less energy, he continued. “We default to lazy litmus tests and shopworn denunciations. It is just emotional pabulum fed from a trough of outrage. It is exhausting. It saps meaning from our politics. And it discourages good people from pursuing public service.

“The symptoms of it are in our face all the time. And we have to recognize that its roots run deep, into our society and our culture today. All of this pulls on the threads of our common humanity, in what could be our unravelling.”

Ryan admitted that “the drivers of our broken politics are more obvious than the solutions” but that he intends to work on the latter in the next chapter of his career.

He also took what many will interpret as a swipe at Trump’s brand of “America first” isolationism that has given succour to dictators and left allies reeling. “A confident America leads the world, too,” he told the audience. “Not with bluster, but with steady, principled action. Remember, history has a way of repeating itself.”

Why Bernie Sanders is (still) the most progressive choice for president | Nathan Robinson Read more

Warning of the direct challenge that China’s authoritarian model poses to the west, he said: “The sense I get, from when I have travelled overseas as speaker, is that our allies wonder whether we are still in the game here. When we show that our way of doing things still has juice, that we can do the most good for the most people, liberty gains ground. When we get complacent, we risk seeing more countries go in the direction of the autocrats. A confident America stands up to its challengers by committing to the pillars of international relations.”

Under Ryan, Congress approved the biggest tax cuts in decades, boosted defence spending and rolled back Obama regulations to protect clean air and water. He described the House as “the most productive we have had in a generation”, citing the passage of more than 1,000 bills, though most were minor.

But the national debt is surging, Medicare and other welfare programmes are growing and the attempt to tear down Obamacare foundered in the Senate. “In this Congress, we came within one vote of real healthcare entitlement reform,” Ryan said wistfully. “Think of that.”

His remarks were met by polite applause from the mostly white audience. But even as Ryan spoke, across the street Congress was struggling to avoid a partial government shutdown over Trump’s demand for taxpayer money to build a wall on the Mexican border.