The mayor of Washington DC has bowed to pressure from Walmart and vetoed minimum-wage legislation that would have hampered the supermarket giant's push into urban America.

Vincent Gray said the legislation, which would have forced large retailers to pay staff at least $12.50 an hour, would drive away employers and threaten 4,000 jobs in the city.

His intervention angered campaigners who had hoped that a Large Retailer Accountability Act passed by DC's city council would protect unionised shop-workers and act as a bulwark against the spread of low-cost retailers into US inner cities.

Walmart, which has largely saturated suburban and rural markets in the US, had threatened to scrap three planned stores in poorer areas of DC and threatened three other sites already under construction if the legislation was enacted. The highly-targeted law required all companies with more than $1bn in global sales and operating in spaces larger than 75,000 square feet to pay at least $12.50, rather than the standard minimum wage of $8.25, unless they had collective bargaining agreements.

But Gray, who has been a vocal supporter of Walmart's plans for six new megastores, said the bill was a "job killer" that would also drive away companies such as Target, Home Depot, Wegmans, Lowe's, Walgreens, Harris Teeter, AutoZone and Macy's.

"I am vetoing this legislation precisely because I believe in providing a living wage to as many District residents as possible – and this bill is not a true living-wage measure," said Gray. "While the intentions of its supporters were good, this bill is simply a woefully inadequate and flawed vehicle for achieving the goal we all share."

His intervention echoes a similar fight in Chicago seven years ago, when a mininum wage bill passed by the city council was vetoed by the mayor, Richard Daley. It could also pave the way for Walmart to expand into other eastern cities, such as New York and Boston, where it has faced fierce resistance. Last year, Walmart battled its way into downtown Los Angeles; it is not yet established in central San Francisco or Seattle.

Gray's decision was widely expected, but it prompted an angry response from union-led campaigners.

Demonstrators march and block traffic outside a Walmart store in Hyattsville, Maryland. Photograph: Chip Somodevilla/Getty Images

Reverend Graylan Hagler, of Plymouth United Congregational Church of Christ and Faith Strategies: said: "Unfortunately, the Mayor's decision is hardly surprising because this is exactly what Walmart's lobbyists said would happen. The Mayor's office and Walmart have been working together to defeat this bill from the start.

"If we cannot demand higher wages and good jobs from the nation's and world's largest corporations, DC will not be able to remain a diverse and vibrant city. We strongly urge the city council to override this misguided veto."

In a company statement a Walmart spokesman, Steven Restivo, praised Gray for choosing "jobs, economic development and common sense over special interests".

"Now that this discriminatory legislation is behind us, we will move forward on our first stores in our nation's capital," Restivo says. "We look forward to finishing the work we started in the city almost three years ago: a plan to bring more jobs, shopping options and fresh food choices to Washington DC residents."