WASHINGTON — Sen. Bernie Sanders declared war on Amazon last month with a sweeping new bill that would tax large companies for employees who receive public benefits.

The name wasn't subtle: The Stop Bad Employers by Zeroing Out Subsidies Act — shortened to "Stop BEZOS" — and neither was its targets: large companies like Jeff Bezos' Amazon and Walmart, both of which have been come under criticism for underpaying workers.

But Sanders, the Vermont independent and potential 2020 presidential hopeful, couldn't say enough nice things about Bezos on Tuesday after the CEO announced that Amazon was raising wages to $15 an hour for workers across the board, including part-time and seasonal employees.

"Today, I want to give credit where credit is due and I want to congratulate Mr. Bezos for doing exactly the right thing," Sanders said. "I urge corporate leaders around the country to follow Mr. Bezos' lead, and I congratulate him for what he has done."

Bezos did not mention the legislation in his announcement, but said he had "listened to our critics" and pledged to work with lawmakers to raise the national minimum wage to $15, a top priority among progressive politicians like Sanders. And he even thanked Sanders for his kind words on Twitter.

Thank you @SenSanders. We’re excited about this, and also hope others will join in. https://t.co/kasWkkOhWo — Jeff Bezos (@JeffBezos) October 2, 2018

The news gives Sanders a significant boost amid harsh criticism from fellow progressives over the Stop BEZOS bill. The backlash fed into an ongoing debate among Democrats about how to balance rabble-rousing populism and policy substance, one that is likely to continue into the 2020 presidential primaries.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Sanders originally pitched his bill as a way to punish wealthy employers for not providing adequate wages, which he framed as part of a "rigged economy," with the hope that it would encourage employers to raise wages. Amazon had said in a blog post that Sanders was making "inaccurate and misleading accusations."

It wasn't just Amazon that was unhappy. An array of experts predicted Sanders' legislation would fail to achieve its goals if it became law and instead do serious harm to low-income workers by making employers less likely to hire them and politicians more likely to enact future benefit cuts.

"I think that it just completely misunderstands the economics of it," Betsey Stevenson, an economist at the University of Michigan, told NBC News. "If we tax companies that hire people who receive benefits, there's a natural response, and it's for companies to try to hire people who don’t receive benefits."

Sanders' defenders argued this type of criticism missed the point, even as some conceded it was technically accurate on the merits. The bill never had a chance of passing anytime soon, some argued, and it was instead designed to focus anger on working conditions and wages at large corporations, while mobilizing voters to demand action.

On Tuesday, Stop BEZOS backers pointed to Amazon's capitulation as proof that their approach is working.

"Many in the Beltway criticized our bill as impractical," Rep. Ro Khanna, D-Calif., who co-sponsored the Stop BEZOS Act, said in a statement. "But Amazon's action shows that our bill can inspire multibillion dollar companies to raise the wages of their workers. Hopefully more companies will follow Amazon's lead."

As Khanna's statement seemed to allude to, even experts sympathetic to his take on labor practices argued the bill would undercut its own goals. Rather than raise wages, they said, companies would be more likely to discriminate against potential hires, especially single mothers, who qualify for a wide range of aid.

The criticism prompted some harsh exchanges. A policy aide to Sanders, Warren Gunnels, criticized the Center on Budget and Policy Priorities, a left-leaning think tank that published a piece criticizing the bill, for taking donations from Walmart in response.

Robert Greenstein, the think tank's president, said the charge was "scurrilous and unfounded" given that the group promotes an array of progressive policies that overlap with Sanders, like a higher minimum wage.

But the dispute also highlighted another major criticism of the Stop BEZOS bill: It would give companies a new incentive to try to cut public benefits.

According to Greenstein, Walmart's funding went toward an initiative researching anti-hunger programs like SNAP, which the company has lobbied lawmakers to shield from budget cuts. As of now, those benefits both aid their workers and allow their customers to spend more. If the Stop BEZOS bill passed, however, large corporations could shift gears and push Congress to cut benefits or narrow their eligibility to reduce their tax bill.

"You'd likely get a number of corporations lobbying in favor of slashing the programs," Greenstein said.

With Amazon's announcement, Sanders' office was quick to claim credit for nudging Bezos toward its position by helping to keep activists and workers fired up.

"The goal of the Stop BEZOS Act was to raise awareness about Amazon's low pay and bad working conditions and put pressure on Jeff Bezos to do something about it," a Sanders spokesman, Josh Miller-Lewis, told NBC News on Tuesday.

"But it wasn't just the bill," Miller-Lewis said. "Videos that we put out about Amazon over the last few months have been seen more than 50 million times. Hundreds of workers spoke up, at great risk, to demand better wages. Activists have been fighting Amazon for years. Those efforts paid off today."