Amazon's glass spheres in Seattle are part of a wave of development in the city by the company. Amazon is the city's largest employer with more than 45,000 local workers.CreditKyle Johnson for The New York Times

By David Streitfeld and Claire Ballentine

Seattle officials scuttled a corporate tax on Tuesday that they had wholeheartedly endorsed just a month ago. The vote delivered a big win for Amazon and offered a warning to cities eagerly bidding for the retailer's second headquarters: This is a corporation that will go to the limit to get its way.

The tax would have raised about $50 million a year to help the homeless and fund affordable housing projects. As Seattle has boomed over the last decade, in large part because of Amazon, rents have soared and some residents have suffered. The city's homeless population is the third largest in the country, after New York and Los Angeles.

Taxing successful companies to help alleviate some of the problems that their success caused was such a compelling idea that it was quickly taken up in Silicon Valley itself. California cities like Cupertino, East Palo Alto, Mountain View and San Francisco have recently explored various measures.

But in Seattle, the notion has proved extraordinarily contentious.

The Seattle City Council repealed the tax in a 7-to-2 vote on Tuesday that was accompanied by acrimony and accusations. Less than a month ago, it had passed unanimously. What changed in those weeks was a realization that corporate interests — not only Amazon but Starbucks, the Microsoft co-founder Paul Allen's investment firm Vulcan and local food and grocery firms — would continue to fight against it, and that at least some residents agreed with the companies.

The opponents funded No Tax on Jobs, an effort aimed at getting enough signatures to put a repeal on the November ballot. It became clear over the weekend that the measure would succeed in coming before voters, leading Jenny Durkan, Seattle's mayor, and seven council members to issue a statement saying, "We heard you."