House Speaker Paul Ryan will leave Congress having achieved one of his career goals: rewriting the tax code. On his other defining aim — balancing the budget and cutting back benefit programs like Social Security, Medicare and Medicaid — Ryan has utterly failed.

Ryan, a budget geek with a passion for details who announced Wednesday that he would retire next year, proved adroit in drawing up budget plans that balanced on paper but didn't get beyond the hypothetical. Under his leadership, Republicans never tried to implement the deep cuts his budget called for, particularly his vision of turning Medicare into a voucher-like program for future retirees. Instead, the House passed steep tax cuts while increasing spending, setting the government on a path to rising deficits.

The gap between Ryan's reach and his grasp was especially stark this week. The Congressional Budget Office said Monday that the tax bill and last month's $1.3 trillion spending bill would add more than $2.6 trillion to the national debt over the coming decade — and the looming return of the first trillion-dollar deficits since President Barack Obama's first term.

Get Breaking News Delivered to Your Inbox

The rising deficits don't lay at Ryan's feet alone. Although the 48-year-old lawmaker from Wisconsin was an aggressive salesman for his plans, and was once viewed as the new face of a GOP focused on shrinking the size of government, the party ultimately did not turn his way. President Donald Trump had no interest in Ryan's Medicare proposal and even called it a political loser during the 2016 primary campaign. Senate Majority Leader Mitch McConnell, R-Ky., has made clear he's not interested in taking on Social Security reforms.

"I feel from all the budgets that I've passed, normalizing entitlement reform, pushing the cause of entitlement reform and the House passing entitlement reform, I'm very proud of that fact," Ryan said Wednesday.

Still, this was not likely how a young Ryan, who cut his teeth in Washington as a speechwriter for conservative icon Jack Kemp, imagined closing out his career.

Earlier in his career, Ryan was an advocate for partially privatizing Social Security by allowing younger retirees to steer a portion of their payroll taxes into retirement accounts. That idea cratered in 2005 despite a determined push by President George W. Bush.

"Collectively, Congress is always fearful of taking on tough issues, and there's no budget issue tougher than Medicare and Social Security," said former Sen. John Sununu, R-N.H., who co-sponsored Ryan's 2005 Social Security bill. "It's been true for three decades or more."

As a 20-something in Washington, Ryan worked for the Empower America think tank, and in Congress his fiscal ideas often performed better on paper than they did in the realpolitik world of Capitol Hill. For instance, Ryan for years had promised that tax reform would include big income and corporate rate cuts paid for by wiping away popular tax breaks.

Instead, last year's bill managed to cut tax rates by adding $1.4 trillion to the deficit and through gimmicks like making many of the tax cuts expire in just a few years.

"I don't know whether this will pay for itself or not, but I do know that this is going to create the kind of growth we need to get out of the hole we're in," Ryan said at the time.

Meanwhile, Ryan's plans to cut benefit programs faced the acid test last year as well, during last year's health care debacle. He succeeded in passing a repeal of Obama's health care law through the House last year that would have capped the Medicaid health program for the poor and disabled, cutting more than $800 billion from the program over 10 years. Ryan called it the "most fundamental entitlement reform in a generation."

But the "Obamacare" repeal effort imploded in the Senate, leaving the growth of Medicaid untouched and the health care law's subsidies in place. Politically, the effort both angered the GOP base and whipped up the Democratic opposition.

"Under Paul Ryan, the deficit certainly increased dramatically, so all that great think tank policy and great ideas wasn't able to translate into legislation and that has a huge fiscal cost," said Maya MacGuineas, president of the Committee for a Responsible Federal Budget, a Washington group that advocates for lower deficits.