Ben Fox Rubin/CNET

Amazon said Thursday it is canceling its plans to build a new major campus in New York City, in an abrupt end to a high-profile project from the world's largest e-commerce company.

Following a yearlong public search for a new second headquarters, dubbed HQ2, Amazon in November announced plans to build two 25,000-employee campuses, one in Long Island City, in New York's Queens borough, and another in Arlington, Virginia. Both locations were selected from over 200 bidders and were expected to receive $2.5 billion in investments from the e-commerce giant. Amazon also selected Nashville to host a new 5,000-person "center of excellence."

Now playing: Watch this: Amazon kills plans for NYC headquarters

But the New York City campus received quick and persistent criticism from local union supporters, the New York City Council and a number of elected officials, including state Sen. Michael Gianaris and US Rep. Alexandria Ocasio-Cortez, who both represent parts of Queens. Amazon cited that opposition from state and local politicians as a critical reason for canceling the project, saying it required "positive, collaborative relationships" to undertake a large project that would be built over a decade.

"We do not intend to reopen the HQ2 search at this time," Amazon said Thursday. "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 US and Canada."

Amazon declined to comment beyond its statement.

The company employs over 5,000 people in New York City and said it plans to continue growing those teams.

We are disappointed to have reached this conclusion. Amazon

Several protests were staged against the planned campus, and Amazon executives faced withering criticism during two city council meetings. Council members pilloried the company for its mostly non-union workforce and alleged work with US Immigration and Customs Enforcement. Amazon's incentives package of about $3 billion was also a major concern, especially because of the company's massive size and CEO Jeff Bezos' status as the world's richest person.

"Defeating an unprecedented act of corporate welfare is a triumph that should change the way we do economic development deals in our city and state forever," City Councilman Jimmy van Bramer, a leading critic of the project who represents Queens, said in a statement Thursday.

"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," Chelsea Connor, director of communications for the Retail, Wholesale and Department Store Union, said in a statement Thursday.

The union has been a frequent critic of Amazon's working conditions and has partnered with Amazon warehouse workers in Staten Island in their push to unionize.

Rebecca Kolins Givan, an associate professor at the Rutgers School of Management and Labor Relations, said the collapse of the deal was the "inevitable result" of Amazon's reputation as an anti-union company going up against "the most unionized large city in the country." She said Walmart was forced to give up coming to New York City after similar opposition from union supporters.

Despite loud opposition to the plan, the company as recently as Friday said it was "focused on engaging with our new neighbors" on the project following reports it was considering scrapping the campus. A Quinnipiac poll from December also showed strong support for the new campus, with 60 percent of Queens residents approving of the project and 26 percent against it.

The company received backing from New York Gov. Andrew Cuomo and New York Mayor Bill de Blasio, who pushed to get the highly coveted project. Cuomo said last week that opposition in the state senate against HQ2 was "governmental malpractice." James Patchett, head of the New York City Economic Development Corp., also repeatedly argued for the massive benefits of the HQ2 project during the heated council meetings, saying it would protect New York from future recessions and be a boon for its development as a tech hub.

De Blasio seemed to put blame on Amazon for walking away. "You have to be tough to make it in New York City," he said in a statement. "Instead of working with the community, Amazon threw away that opportunity."

Tech:NYC, a group that advocates for the growth of the tech industry in the city, called Amazon's decision "a blow to the local economy."

Our statement on Amazon’s decision to withdraw its #HQ2 from New York: pic.twitter.com/n0ehJh8NDJ — Tech:NYC (@TechNYC) February 14, 2019

Bankrate.com senior economic analyst Mark Hamrick said that Amazon essentially caved to local opposition and that the decision not to come won't solve long-term problems like housing affordability.

"For those who didn't want Amazon to bring the promised 25,000 new jobs and added economic vitality to the area: Be careful what you wish for," he said.

Here is the company's full statement:

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. 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% 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. We are disappointed to have reached this conclusion—we love New York, its incomparable dynamism, people, and culture—and particularly the community of Long Island City, where we have gotten to know so many optimistic, forward-leaning community leaders, small business owners, and residents. There are currently over 5,000 Amazon employees in Brooklyn, Manhattan, and Staten Island, and we plan to continue growing these teams. We are deeply grateful to Governor Cuomo, Mayor de Blasio, and their staffs, who so enthusiastically and graciously invited us to build in New York City and supported us during the process. Governor Cuomo and Mayor de Blasio have worked tirelessly on behalf of New Yorkers to encourage local investment and job creation, and we can't speak positively enough about all their efforts. The steadfast commitment and dedication that these leaders have demonstrated to the communities they represent inspired us from the very beginning and is one of the big reasons our decision was so difficult. 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. Thank you again to Governor Cuomo, Mayor de Blasio, and the many other community leaders and residents who welcomed our plans and supported us along the way. We hope to have future chances to collaborate as we continue to build our presence in New York over time.

First published at 8:59 a.m. PT on Feb. 14.

Updated at 9:59 a.m. PT and 10:30 a.m. PT: Adds more details throughout.

NASA turns 60: The space agency has taken humanity farther than anyone else, and it has plans to go further.

Taking It to Extremes: Mix insane situations -- erupting volcanoes, nuclear meltdowns, 30-foot waves -- with everyday tech. Here's what happens.