Rep. Alexandria Ocasio-Cortez and activists celebrated Amazon's Thursday announcement that it would not move forward with its planned second headquarters, known as HQ2, in Queens, New York.

Ocasio-Cortez called the retreat a win for "everyday New Yorkers" in the fight against "Amazon's corporate greed, its worker exploitation, and the power of the richest man in the world," CEO Jeff Bezos.

Local activists, including the Democratic Socialists of America, have spent the past few months aggressively mobilizing grassroots opposition to the deal, which Amazon said would have brought 25,000 jobs to the city.

But a recent poll found that the majority of Queens residents said they supported Amazon's HQ2 plans.

Rep. Alexandria Ocasio-Cortez celebrated Amazon's Thursday announcement that it would not build its second headquarters, known as HQ2, in the Long Island City neighborhood of Queens, New York, as a result of local political opposition.

Ocasio-Cortez, whose Bronx and Queens district borders Long Island City, celebrated the announcement as a win for grassroots activism.

"Anything is possible: 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," Ocasio-Cortez tweeted.

When Amazon announced last November that it had reached a deal to build a second headquarters in Long Island City, Ocasio-Cortez and a host of local lawmakers and activists condemned the decision.

"We were not elected to serve as Amazon drones," City Council member Jimmy Van Bramer and state Sen. Michael Gianaris, both of whom represent Long Island City, said in a fiery joint statement at the time.

Some local politicians were outraged by the nearly $3 billion in tax incentives Gov. Andrew Cuomo and Mayor Bill de Blasio offered Amazon, one of the world's largest companies. They were also highly critical of dealmaking that circumvented the City Council and avoided the standard city processes for making land-use decisions.

Read more: More than 80% of Americans support almost all of the key ideas in Alexandria Ocasio-Cortez's Green New Deal

Activists including the Democratic Socialists of America, of which Ocasio-Cortez is a member, have spent the past few months aggressively mobilizing grassroots opposition to the deal.

DSA celebrated the news on Thursday and promised to continue to fight against Amazon and other corporations.

Annie Shields, a member of the local DSA chapter and an editor at The Nation, a progressive magazine, called the corporation's retreat "a testament to what is possible when people organize together." She added that she had rarely seen DSA members so fired up about an issue.

"Meetings and events for this campaign were jam-packed, and there was a critical mass of supporters to help create a formidable coalition to stop the deal," Shields told INSIDER.

In November, Ocasio-Cortez said her office was overwhelmed with "outrage" from Queens residents and other constituents who were concerned about the tax incentives when "our subway is crumbling and our communities need MORE investment."

But a recent poll found that the majority of Queens residents supported the deal, even with the massive tax incentives. Support for the deal was higher in Queens and the Bronx than in Manhattan and Brooklyn. Some major New York City unions were also in favor of HQ2.

In its statement, Amazon praised Cuomo and de Blasio and blamed its retreat on state and local lawmakers.

"For Amazon, the commitment to build a new headquarters requires positive, collaborative relationships with state and local elected officials who will be supportive over the long-term," the company said. "While polls show that 70% of New Yorkers support our plans and investment, a number of state and local politicians have made it clear that they oppose our presence and will not work with us to build the type of relationships that are required to go forward with the project."

Gianaris didn't welcome the news, comparing Amazon to "a petulant child."

Read more: THE TRUTH ABOUT ALEXANDRIA OCASIO-CORTEZ: The inside story of how, in just one year, Sandy the bartender became a lawmaker who triggers both parties

"Amazon insists on getting its way or takes its ball and leaves," he told The New York Times. "The only thing that happened here is that a community that was going to be profoundly affected by their presence started asking questions."

State Sen. Jessica Ramos, a Democrat who represents Queens, called the development a victory for "grassroots community organizing." She noted that Amazon is still planning to build a distribution center in her home borough.

"What we, the people, did in Queens was finally draw the line in the sand," Ramos said in a statement, adding, "Queens is not for sale."

With the 25,000 jobs it promised for the New York HQ2, Amazon would have become the 11th-largest employer in the New York City area, behind the city, state, and federal governments, several hospital systems, and the financial behemoth JPMorgan Chase.

Additionally, a study commissioned by the governor's office found that HQ2 would bring a substantial amount of new tax revenue and economic development to the area. Critics, however, argued that the study had a limited scope and did not account for downsides associated with the project.

The saga of Amazon's HQ2 project began in September 2017, when Amazon put out its official request for proposals and nearly every major US metro area threw its hat in the ring. After courting cities, Amazon announced last November that it would split HQ2 between New York and Virginia, where it has also promised to create 25,000 jobs.