CHICAGO (CBS/CNN) — Amazon has chosen New York City and Northern Virginia to share its $5 billion HQ2, dashing Chicago’s hopes of luring tens of thousands of jobs and cementing the city’s status as a leading tech hub.

Tuesday morning, Amazon announced it would split its coveted second headquarters into two sites in the Long Island City neighborhood in Queens, New York, and in Arlington, Virginia, just outside D.C.

Amazon has said it would invest $5 billion and create more than 50,000 jobs to create HQ2. Those jobs will be split evenly between New York and Arlington. Hiring will begin next year.

During the yearlong selection process, Amazon narrowed down 238 bids to 20 finalists, including Chicago. Executives visited the city at least twice to tour potential locations for its new facility.

“We are excited to build new headquarters in New York City and Northern Virginia,” Amazon founder and CEO Jeff Bezos said. “These two locations will allow us to attract world-class talent that will help us to continue inventing for customers for years to come. The team did a great job selecting these sites, and we look forward to becoming an even bigger part of these communities.”

Amazon’s criteria for HQ2 included proximity to a major airport, ability to attract technical talent and a suburban or urban area with over 1 million people.

The search ignited a frenzy among cities looking to boost their economies. Some cities responded with elaborate gestures to try to woo Amazon. Tucson, Arizona, famously sent Amazon CEO Jeff Bezos a giant cactus, and Birmingham, Alabama, installed massive Amazon delivery boxes around the city. Kansas City’s mayor gave five-star reviews to 1,000 random items on Amazon’s website, and Stonecrest, Georgia offered to rename some of its land the city of Amazon.

Amazon has said employees who work in Seattle will have a chance to relocate. It will also hire teams and executives for the new locations.

The company estimates that its investments in Seattle from 2010 to 2016 added $38 billion to the city’s economy. These investments include buildings, parks and infrastructure, such as corporate offices and Prime Now delivery sites.

But Amazon’s search for HQ2 was never just about finding a new home.

Throughout the process, Amazon skillfully obtained free data from cities across North America, including proprietary information about real estate sites under development, details about their talent pool, local labor cost and what incentives cities and states were willing to pony up to bring the company to town.

“Amazon was not going through this exercise to pick a single HQ2,” said Richard Florida, a leading urbanist and professor at the University of Toronto. “It was part of a broader effort — a corporate relocation strategy — to crowd source a wide variety of data.”

And the company itself has said it would use the information from the bids when considering where to open new facilities, such as warehouses and smaller corporate offices. Several cities that didn’t make the final 20 have already seen an investment from Amazon, including fulfillment centers in Spokane, Washington, and Ottawa, as well as a new office in Vancouver with jobs in fields like machine learning and cloud computing.

(© Copyright 2018 CBS Broadcasting Inc. All Rights Reserved. The CNN Wire contributed to this report.)