Amazon canceled plans to build a campus in New York City with at least 25,000 high-paying jobs on Thursday because of resistance from local elected officials, unions and community activists who said a project initially hailed as an economic triumph was a lousy deal.

"There are a number of folks on the ground who oppose our presence," Amazon spokeswoman Jodi Seth said. "We don't think there's a path forward in terms of working with them over the long term."

The company issued a statement shortly before noon saying it did not intend to immediately reopen its search for a second headquarters, but would continue with plans to put at least 25,000 jobs in Arlington in northern Virginia and 5,000 in Nashville, Tenn.

The decision was a stunning reversal for Amazon, which badly miscalculated how it would be received when it said it would put half of the 50,000 jobs promised in its much-publicized HQ2 search in the Long Island City neighborhood of Queens.

While Gov. Andrew Cuomo and Mayor Bill de Blasio, both Democrats, celebrated the announcement, and opinion polls showed large majorities in favor of the deal, a strong backlash quickly developed.

Opponents, including freshman Rep. Alexandria Ocasio-Cortez (D., N.Y.), protested that the influx of Amazon employees, to be paid an average salary of at least $150,000 a year, would cause housing costs to skyrocket, drive out low-income residents, and worsen congestion on the subway and streets.

They also objected to as much as $3 billion in state and local incentives promised to Amazon, which they said should not get such subsidies given that it is the world’s most valuable company and headed by Jeff Bezos, the world’s wealthiest person. (Amazon founder and CEO Bezos owns the Washington Post.)

Some of Amazon’s competitors, such as Google, have expanded their presence in New York -- and taken advantage of its high-tech talent pool -- without seeking large state subsidies.

Amazon’s announcement came six days after the Washington Post broke the news that the company was reconsidering the New York project because of local opposition. That report prompted more than a dozen jurisdictions that pursued the deal originally -- including Washington, Chicago, Miami and Newark -- to reach out to Amazon again with the hope of luring the jobs if the New York deal collapsed.

But the company said it was not looking to put all 25,000 of the jobs slated for New York in a single location.

"We do not intend to reopen the HQ2 search at this time," the company said in a blog post. "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."

Virginia state legislator Rip Sullivan said an Amazon contact told him Thursday morning that the pullout from New York has “no impact on their plans for Arlington, their schedule or scope of plans” in northern Virginia.

De Blasio, whose support for the Amazon project disappointed many of his liberal supporters, faulted the company for backing out.

"You have to be tough to make it in New York City," de Blasio said in a statement. "We gave Amazon the opportunity to be a good neighbor and do business in the greatest city in the world. 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. If Amazon can't recognize what that's worth, its competitors will."

A New York union that helped lead the opposition also attacked Amazon.

“Rather than addressing the legitimate concerns that have been raised by many New Yorkers Amazon says you do it our way or not at all, we will not even consider the concerns of New Yorkers. That’s not what a responsible business would do,” said Chelsea Connor, spokeswoman for the Retail, Wholesale and Department Store Union (RWDSU).

New York's resistance to the Amazon project has been in sharp contrast with the generally warm welcome that Virginia gave the company. With little opposition, Virginia has already passed a law granting Amazon up to $750 million in state incentives over the next 15 years, on condition that it create 37,850 new jobs over that period.

In New York, however, it would have taken until 2020 to win final approval for the state's subsidy package. In a critical setback for the project, the state Senate on Feb. 4 nominated a strong critic of the Amazon incentives, state Sen. Michael Gianaris, a Democrat from Queens, to a state board where he could effectively veto the deal.

Cuomo blasted the Senate for making the move, but didn't say whether he would accept the nomination. If he rejected it, it would spark a major rift between the governor and the Democratic-controlled legislative chamber.

The Senate’s action came after two New York City Council hearings where activists booed Amazon executives and unfurled banners criticizing the company. Key officials opposing the project included City Council Speaker Corey Johnson and Deputy Leader of the City Council James Van Bramer.

The Amazon announcement cited the elected officials' opposition as a major reason for its decision.

“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 said. “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. While polls show that 70 percent 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 we and many others envisioned in Long Island City.”

After the Post reported that Amazon was having second thoughts, business leaders in New York began raising concerns about what turning the company away would mean for the city’s reputation. Speaking to investors Tuesday, Steven Roth, chief executive of commercial real estate stalwart Vornado Realty Trust, said that “if the political climate in New York blows this deal, it would be the stupidest damn thing I’ve ever seen.”

After Amazon announced its decision, concerns about the message New York was sending other tech firms quickly grew. Julie Samuels, executive director of the industry group Tech:NYC, said the move was a reminder that despite the city’s growing economy “there is no guarantee we will maintain this status in the future, which makes this news so disappointing.”

"It's especially disappointing given the overwhelming local support for the deal and there can be no doubt that bad politics got in the way of good policy here," she said in a statement.

Even though Amazon said it wasn't looking to shift the 25,000 New York jobs to a single spot, the announcement prompted suitors to renew their pitches for Amazon to come to their jurisdictions.

Asked about Amazon's decision, Maryland Gov. Larry Hogan, a Republican, said "We actually have had preliminary discussions with them already and we're looking forward to meeting with them to discuss it further."

Maryland offered Amazon more than $8 billion in state and local incentives for 50,000 jobs when Montgomery County made the list of 20 finalists in the HQ2 contest. Hogan previously had championed Port Covington in Baltimore as his favored site.

Brian Kenner, D.C. deputy mayor for planning and economic development, said, "We continue to have conversations with Amazon, as we do with other companies, to discuss how the city can collaborate to support job growth and workforce development."

Last Friday, just hours after the Post reported Amazon was reconsidering the Amazon project, Illinois Gov. J.B. Pritzker, a Democrat, phoned an Amazon executive to offer Chicago as an alternative. He “reached out to Amazon to make a full-throated pitch to attract these good-paying jobs to Illinois and assure them that they would have a strong partner in the governor’s office,” spokeswoman Jordan Abudayyeh said.

_____

The Washington Post’s Mark Berman, Patricia Sullivan and Ovetta Wiggins contributed to this article.