The deal drew opposition even before it was officially announced.

In the days after news broke that Amazon picked Queens for half of its coveted HQ2 in exchange for hundreds of millions of dollars of tax subsidies - a report that landed a day before the 2018 midterm elections - the negative reactions began to trickle from a newly energized left wing in New York. But it wasn't long before the trickle grew into a torrent, and their list of grievances was damning.

The company, valued at $800 billion as of early February, held a years-long beauty pageant of a search for what was believed to be a single headquarters, only to split its workforce and settle on two already-thriving East Coast cities. New York Gov. Andrew Cuomo, already out of favor with his party's progressive wing, joked about changing his name to "Amazon," a not so subtle wink and nod to selling out that was particularly tone-deaf. Most significantly, the deal was approved through a process that prevented city officials and residents from weighing in at all - let alone vetoing the plan.

By the end of that week, public officials in New York were coming out against the deal - including two of the key officials who represented the area, Councilman Jimmy Van Bramer and State Sen. Michael Gianaris.

"It's like getting a marriage offer along with a confession of infidelity," read a scathing New York Times opinion piece by New York Assemblyman Ron Kim and Zephyr Teachout, a law professor who is popular with progressives. "Despite the familiar promises, Amazon is not a good partner. Not for the cities it occupies, not for the merchants who depend on it, not for the workers it employs. The company does not seek partnership; it seeks control."

Amazon, whether it had anticipated the reaction or not, had stepped into a political storm: a cauldron of progressive energy whipped up by simmering resentments both local and national that was cresting just as the plan came together. And with the company's announcement Tuesday that it would drop its plan to situate its headquarters in New York, it was clear that those headwinds became too strong for the company to want to press on.

The decision is a show of force for the resurgent left wing in New York, a constellation of newly elected lawmakers, traditional activist groups and engaged citizens who collaborated to oppose the deal as it was construed.

"I hope this is the start of a conversation about vulture capitalism and where our tax dollars are best spent," City Council Speaker Corey Johnson said in a statement.

"Here is a company that has concentrated so much power that they think they can dictate to states and cities what they're allowed to tell their people, how much money of theirs they want to take, to grace us with their presence," State Sen. Mike Gianaris told reporters.

"Today was the day a group of dedicated, everyday New Yorkers & their neighbors defeated Amazon's corporate greed, its worker exploitation, and the power of the richest man in the world," tweeted Rep. Alexandria Ocasio-Cortez, whose district is adjacent to the proposed development.

Activist groups expressed surprise that the company had walked away from the deal so quickly.

"We knew we had a big fight ahead of us," said Anatole Ashraf, a Queens resident and founding member of one of the groups that formed to oppose the new Amazon site, PrimedOut NYC. "We thought it could drag on for years. . . . We were settling in for the long haul."

Many said their initial opposition to the deal was rooted in its secrecy. The plan had been negotiated among Cuomo, Mayor Bill de Blasio and Amazon without having gone through the lengthy and public approvals process that normally governs development proposals in New York. Local elected officials said they and community groups had not been consulted.

"I learned about the deal, along with all of my neighbors, the minute that it hit the press, which is not exactly how a community should first hear about a huge project that would impact nearly every aspect of their lives," State Sen. Jessica Ramos, who represents a nearby district in Queens, where Amazon planned to include a distribution center, said in an interview. "It's about making sure public due process is respected. But also that there's an understanding, especially from executive branches of government that there are representatives for districts and neighborhoods exactly for this purpose - to ensure that community leaders have a seat at the table. This is a deal that wasn't done with us and wasn't for us."

Ramos, part of a crop of progressive lawmakers, including Ocasio-Cortez, who helped injected the party with progressive energy after defeating incumbent Democrats during the primary last summer - said the opposition coalesced quickly.

"I remember having conversations with community activists that day," she said, after first learning about the company's plans. "At the beginning, there was a scramble for details, for understanding what it was the city and state had agreed to."

The formal announcement on Nov. 12 started an instant wave of condemnation, as the deal's details emerged, like the nearly $3 billion in public subsidies and the optically unsavory helipad for Amazon CEO Jeff Bezos. A buzzword emerged to describe the deal, a point of focus since Occupy Wall Street galvanized the left in 2011: corporate welfare.

Within two days, there was a boisterous protest held in the Long Island City neighborhood where the headquarters was planned. One city councilman noted that it had been easier for Amazon to secure the deal than it would be for a sidewalk cafe to open in his neighborhood. People in the crowd yelled things like "The mayor is a sucker." Some speakers noted Amazon's connections with government agencies like Immigration and Customs Enforcement and the Department of Defense through a contentious facial recognition software program it's developed.

That morning, the New York Post ran a front page that skewed Bezos, a photo illustration that showed him in a helicopter above queens with two bags of money. "QUEENS RANSOM," the headline blared.

(Bezos owns The Washington Post.)

Activists, including some with the Democratic Socialists of America, had begun canvassing neighborhoods in Queens and in the subway cars to educate people about the deal.

Maritza Silva-Farrell, the executive director of the public interest group ALIGN, said the fight united a wide array of activists and groups: those rallying for housing, infrastructure and environmental causes, as well as labor organizations and the elected officials with whom these activists often spar. The amount of money proposed for the company's tax break was a nonstarter, she said.

"Everyone had questions about giving a big corporation that much money - especially when we have so many needs here," she said.

Organizers started by urging residents to pressure their City Council members. At a City Council meeting in December, the company's executives were berated by lawmakers in an unusually testy hearing.

A month later, an Amazon representative seemed to make what seemed like a veiled threat at another hearing.

"We were invited to come to New York, and we want to invest in a community that wants us," Brian Huseman told the City Council, saying the company wanted to "be part of the growth of a community where our employees and our company are welcome."

Opponents of the deal had also questioned whether the deal could unravel or whether the city could exit the agreement, The New York Times reported.

But the nail in the coffin may have been on Feb. 4, when Gianaris, a vocal critic of the project, was selected by state Senate leaders to a board that could potentially veto the project, in a challenge to Cuomo's leadership. The governor criticized the choice through a spokeswoman, and the next day spoke to an interviewer about his concerns that Amazon could pull out of the deal. The Post reported three days later that the company was considering withdrawing.

And then Tuesday's news dropped with a thud.

Many questions remain about what the deal's collapse will mean for the company and other municipalities it negotiates in the near future. But there are signs that the victory of local activists could resonate beyond New York's five boroughs.

"This is a huge victory," said Kshama Sawant, a City Council member in Seattle, where Amazon is based, and a member of Socialist Alternative party that has tangled with Amazon. "This is a testament to the kind of victories that ordinary people, working people, can win when we get organized and fight back."

Silva-Farrell, of ALIGN, said that the city will have to figure out what to do with the parcel of land that would have housed Amazon's headquarters.

“We have to figure out what we want to build there, how it’ll be sustainable and how to create jobs,” she said. “We have to decide what kind of country we want for ourselves.”