Amazon is “part of the American economy” and welcome in the Big Apple — but Walmart is an evil job-killer that should never be allowed to open within the five boroughs, Mayor de Blasio said Friday.

De Blasio has been attacking Walmart for years, claiming it pays shoddy wages, is anti-union and and would undercut New York City’s iconic retail brands.

But he’s primed with pride over landing Amazon’s headquarters expansion, despite the online giant’s similar reputation for cutthroat business tactics.

So what’s the difference, a listener asked on Friday during the mayor’s weekly guest spot on WNYC radio.

The listener, named Seth, pointed out that de Blasio fought hard to block Walmart when he was public advocate nearly a decade ago, but is now “rolling out the red carpet for union-busting job killer” Amazon — “especially as New York suffers an exodus of mom-and-pop businesses.”

“The difference here is … the actual front-line work of Walmart,” the mayor responded. “They were going to put vast big-box stories in New York City that would have started to undermine [local] retail.

“Amazon is … part of the American economy,” he continued. “I would ask every good progressive, every listener out there who has a concern about Amazon: How many are using Amazon as part of their daily lives? Whatever you like or dislike about Amazon, Walmart is an entirely different universe in terms of the efforts they’ve undertaken to not only undermine labor, small business, the environment … and obviously the politics of [Walmart’s owners] the Walton family to add to it,” referring to the Waltons’ track record of funneling megabucks to conservative causes.

Another caller, Devin from Astoria, said she is a fan of the mayor but called out the Amazon deal as a giveaway.

“Amazon needs us more than we need them,” she said. “I would expect something like this from Gov. Cuomo to be perfectly honest, but I hold you in a bit of a higher regard and I really disappointed with this,” she said.

New York City and State have promised Amazon $2.5 billion in tax breaks and up to $505 million in a direct subsidy to score half the giant company’s HQ2 expansion — which promises to bring 25,000 jobs and a new campus to the Long Island City waterfront.