Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Amazon announced Thursday that it is backing out of plans to open a new headquarters in New York City, blaming state and local politicians who "had opposed our presence and will not work with us."

The retail giant announced in November it would build a campus in the Long Island City neighborhood of Queens for 25,000 employees, fueled by $3 billion in state and city incentives to Amazon.

"After much thought and deliberation, we’ve decided not to move forward with our plans to build a headquarters for Amazon in Long Island City, Queens," the company statement said.

Many activists said the project would worsen congestion in the area and lead to gentrification and higher housing prices.

The company put the blame for its decision squarely on the shoulders of politicians who had objected to the development and been critical of city and state leaders for offering Amazon huge tax subsidies.

"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."

New York Gov. Andrew Cuomo, a booster of the Amazon deal, expressed anger that "a small group of politicians" put their own "narrow interests above their community."

The Amazon decision will prove costly to "the state's economic future and the best interests of the people of this state," the governor said in a statement.

But City Council Speaker Corey Johnson aimed his ire at Amazon, saying New York rejects "vulture capitalism."

"I look forward to working with companies that understand that if you're willing to engage with New Yorkers and work through challenging issues," Johnson said in a statement. "I hope this is the start of a conversation about vulture capitalism and where our tax dollars are best spent."

New York Mayor Bill de Blasio also blasted the retailer and said other businesses will fill any void from its canceled plans.

Byers Market Newsletter Get breaking news and insider analysis on the rapidly changing world of media and technology right to your inbox. This site is protected by recaptcha

"Instead of working with the community Amazon threw away that opportunity. We have the best talent in the world, and every day we are growing a stronger and fairer economy for everyone," the mayor said.

State Sen. Michael Gianaris, a Democrat who represents the Long Island City neighborhood where Amazon would have been, said the company's action speaks for itself.

“Today’s behavior by Amazon shows why they would have been a bad partner for New York in any event," according to Gianaris. "Rather than seriously engage with the community they proposed to profoundly change, Amazon continued its effort to shake down governments to get its way."

And U.S. Rep. Alexandria Ocasio-Cortez, a Democrat whose district borders Long Island City, celebrated Amazon's withdrawal.

“I think it’s incredible," she told reporters in Washington, D.C. "It shows that everyday Americans still have the power to organize and fight for their communities."

She discounted the potential loss of Amazon's promised 25,000 jobs, saying that taxpayers would have had too “subsidize those jobs. The city was paying for those jobs."

In its announcement last year that it was coming to Queens, Amazon said it was also building hubs in Northern Virginia and Nashville.

Now it will apparently focus its growth there and in its other existing locations with no plans to replace the now-defunct New York project.

"We do not intend to reopen the HQ2 search at this time. We will proceed as planned in Northern Virginia and Nashville, and we will continue to hire and grow across our 17 corporate offices and tech hubs in the U.S. and Canada," the company said.

Nashville Mayor David Briley quickly assured his constituents Thursday that Amazon's plans to open an operations center with 5,000 jobs are still in place with no connection to the New York decision.

Similarly, in Virginia, Arlington County Board Chairman Christian Dorsey said, "Nothing has changed."

"After speaking with an Amazon representative earlier today, we have confirmed that we are moving forward as planned with Amazon’s upcoming headquarters in Arlington," Dorsey said.

Earlier this week, Siena College released findings of a poll that showed that a clear majority of New York state residents approved of the Amazon deal, 56 percent to 36 percent, and residents of the five boroughs were in favor 58 percent to 35 percent.

"There was clear support for this," Siena College Research Institute director Don Levy told NBC News on Thursday. "It's always tough to guess how angry people will be and how it’s going to last, but I think it's going to last awhile."

Cynthia Nixon, who ran unsuccessfully against New York Gov. Andrew Cuomo in last year's Democratic primary, hailed Amazon's stunning reversal.

"Amen," the actress-turned-politician tweeted. "The fight against Amazon laid bare their union-busting, corporate welfare, ICE-abetting practices and shows why we need to break up monopolies like Amazon."

Zephyr Teachout, who ran unsuccessfully for state attorney general last year, and Nixon both accused Amazon of working with law enforcement to develop facial recognition technology that could gather information from customers without them knowing it.

"Now let's get a congressional hearing on Amazon, labor, ICE, monopsony, how and why to break up Amazon," Teachout tweeted, just after Amazon's announcement. "I know some people ready to testify."

Amazon's stock price closed at $1,622.65 a share, down 1.06 percent.

CORRECTION (Feb. 14, 2019, 4;17 p.m. ET): A previous version of this article misstated the month in which Amazon announced it would be building a campus in New York City. It was in November, not December.