President Barack Obama endorsed an expansion of Social Security for the first time on Wednesday.

“We can’t afford to weaken Social Security,” he said during a speech on economic policy in Elkhart, Indiana. “We should be strengthening Social Security. And not only do we need to strengthen its long-term health, it’s time we finally made Social Security more generous, and increased its benefits so that today’s retirees and future generations get the dignified retirement that they’ve earned.”

The increased benefits, he said, could be paid for “by asking the wealthiest Americans to contribute a little bit more. They can afford it. I can afford it.”

This was a far cry from Obama’s position on the program in late 2012, when his administration argued for reducing Social Security benefits by recalculating the way cost of living adjustments are made.

“President Obama’s evolution on Social Security, from at one time being open to cuts to calling for an expansion of benefits … is certainly welcome news, but not at all surprising,” said Alex Lawson, the executive director of Social Security Works, a nonprofit group that advocates for protecting and expanding the program.

Lawson’s organization has worked with lawmakers and other nonprofit organizations to oppose Obama’s proposed Social Security cuts and shift the conversation towards expansion. By the summer of 2014, a small group of Democratic caucus senators, led by Sen. Bernie Sanders, started advocating for lifting Social Security’s payroll tax cap so wealthier people paid more into the system, and then increasing benefits to seniors. Polling by advocacy groups found broad support for expansion.

This idea became a central theme in Sanders’s presidential campaign. In the speech announcing his candidacy, the senator said that “instead of cutting Social Security, we’re going to expand Social Security benefits.”

“It has become impossible for elected officials to ignore the simple fact that Social Security is a solution and not a problem, and that the only thing wrong with it are that benefits are too low,” Lawson said.

In both 2008 and 2012, Obama explicitly campaigned on protecting the Social Security program and rejecting plans that would cut benefits. But shortly after re-election in 2012, the Obama Administration proposed re-calculating the way Social Security’s cost of living adjustments work.

The administration’s budget proposed using the so-called chained Consumer Price Index formula to calculate benefits instead, which would slow the rate of benefit increases in the future so as to reduce overall spending. Social Security Works estimated that under the chained CPI the average beneficiary who just started receiving benefits would receive a yearly benefit $653 lower after 10 years.

Then-White House spokesman Jay Carney defended the move, saying that the budget Obama put forward was “not his ideal budget,” but that it’s a “document that recognizes that to achieve a bipartisan solution to our budget challenges we need to make tough choices.”

Obama’s backtracking set off a furious reaction from seniors groups and progressive activists, who for the next few months mobilized their members to pressure Congress to reject the proposed change. By April 2013, 2.3 million Americans had signed petitions calling on the president to back off of chained CPI. The signatures were presented at a White House rally that featured Sanders, who vowed to “do everything in my power to block President Obama’s proposal to cut benefits for Social Security recipients through a chained consumer price index.”

The senator mobilized a wide coalition or organizations, including veterans, women’s rights groups, and labor unions to oppose chained CPI.

Under this intense activist pressure, the White House was unable to convince its own allies in Congress that this change was worth the political costs. The next year, the chained CPI was quietly dropped from Obama’s budget proposal.

Democratic presidential front-runner Hillary Clinton’s evolution on the issue could also be traced to Sanders. Clinton initially shied away from the question of expanding the program, issuing only noncommittal statements on the issue. But after being directly challenged on the Social Security program this past February by the Sanders campaign, Clinton tweeted, “As always, I’ll defend it, & I’ll expand it.”