House Speaker Paul Ryan bemoaned America's "broken politics" in a farewell speech Wednesday and called Washington's failure to overhaul costly federal benefit programs "our greatest unfinished business."

Ryan said that our country's "complex problems are solvable... if our politics will allow it." But he admitted that "the drivers of our broken politics are more obvious than the solutions," Ryan said. And he worried, "The state of politics these days is another question, and frankly one I don't have an answer for."

As Congress is closing out the year with a fight over funding for President Trump's border wall, Ryan urged his colleagues to think bigger, saying "no matter what the outcome is in the coming days, the larger problem will remain."

Get Breaking News Delivered to Your Inbox

Noting that Mr. Trump's signature border wall is just one aspect of improving the nation's immigration system, Ryan said that Congress needs to modernize the visa system, find a solution for both the DACA recipients who "came here as no fault of their own," and "ultimately the undocumented population."

Ryan also pressed his party to pursue "good free trade agreements that open up now markets to American-made products."

The Wisconsin Republican and former vice presidential candidate spoke at the Library of Congress, across the street from the Capitol where he served two decades in the House of Representatives. It was the same location where he laid out his vision three years ago when he became House Speaker. More than two dozen members of Congress as well as the the men and women who have served on Ryan's staff over the years came to witness his final speech.

"Certainly, one Congress cannot solve all that ails us," Ryan said, noting that "not every outcome has been perfect." Nonetheless, Ryan said he is "proud of what we have achieved together to make this a stronger and more prosperous country."

As part of his departure from Congress, Ryan's office this week released a video series highlighting the 2017 tax cuts that he sees as the central part of his legacy. Ryan, 48, was chairman of the tax-writing House Ways and Means Committee before he became speaker. And in 2012, he was Republican presidential nominee Mitt Romney's running mate.

As Ryan has shifted his focus to his retirement from Congress, he has sought to emphasize less partisan themes in his public appearances. He decried "tribalism" and "identity politics" in an interview with CBS News' "Face the Nation" before the midterm elections and told the Washington Post last month he wished he had accomplished more on immigration reform and on addressing the nation's growing debt.