Amazon has selected New York City and the Washington, D.C., suburb of Arlington, Va., as the winners of its national HQ2 sweepstakes. The e-commerce giant announced Tuesday morning that it plans to invest $5 billion in setting up its new headquarters across the two new locations, each of which are expected to span up to 4 million square feet and house up to 25,000 employees.

As widely anticipated and reported over the past week, the Jeff Bezos-led tech behemoth has chosen the western Queens neighborhood of Long Island City as its new home in New York, while the Arlington, Va., area of National Landing (more traditionally known as Crystal City) will house the company’s D.C. region headquarters.

In a press release, Amazon said the two new locations “will join Seattle as the company’s three headquarters in North America” and that the company’s “investments in each new headquarters will spur the creation of tens of thousands of additional jobs in the surrounding communities.” Amazon expects to start hiring at both of its new headquarters beginning in 2019.

“We are excited to build new headquarters in New York City and Northern Virginia,” Bezos said in a statement. “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 announcement ends more than a year of speculation and prognostication over where one of the world’s largest companies would end up landing as it sought to expand its operations and talent base. The news last year that Amazon would be creating a so-called HQ2 set off a frenzied competition among hundreds of cities across North America who vied for the opportunity and the potentially considerable economic benefits that would come from hosting the tech giant.

Amazon eventually whittled its choices down to a shortlist of 20 markets in January, and earlier this month it emerged that the company was considering splitting the new HQ2—with its promised 8-million-square-foot footprint housing up to 50,000 employees—across two separate cities.

While there was much speculation that Amazon would opt for a lower-cost environment in a secondary market, the selection of New York City and the Washington metro area indicate that the company’s desire to the attract young, highly skilled talent found in the country’s most developed, infrastructurally sophisticated metropolitan regions trumped all else in considering where to set up shop. Indeed, Amazon already has more employees in the New York and Washington regions than anywhere in the country outside of Seattle and the San Francisco Bay Area that is home to Silicon Valley.

“These are tier-one metropolitan areas—they have scale, they have talent pools, they have public transportation [systems] and infrastructures that are very advanced,” Robert Hess, the vice chair of Newmark Knight Frank’s global corporate services practice, told Commercial Observer last week of the speculation surrounding New York City and Washington, D.C.

But Amazon did award one secondary market in the running with somewhat of a consolation prize: It has selected Nashville as the location of a new Center of Excellence for its operations business, which oversees the company’s customer fulfillment, transportation and supply chain activities. Amazon will invest more than $230 million in the Center of Excellence, which will be housed in downtown Nashville and create more than 5,000 new jobs, the company said.

In return for its commitments to New York, Washington and Nashville, Amazon will receive billions of dollars in tax incentives from state and local governments—including nearly $1.53 billion in “performance-based direct incentives” from New York State and potentially hundreds of millions more through New York City’s Industrial & Commercial Abatement Program (ICAP) and the city’s Relocation and Employment Assistance Program (REAP). Virginia is providing the company with $573 million in performance-based direct incentives and an additional $223 million in infrastructure improvements, while Tennessee is granting $102 million in performance-based direct incentives.

Numerous state and local politicians responded enthusiastically to the news of Amazon’s arrival in their constituencies, with New York Gov. Andrew Cuomo saying the state has “attracted one of the largest, most competitive economic development investments in U.S. history” and New York City Mayor Bill de Blasio describing Amazon’s investment as an “opportunity to open up good careers in tech to thousands of people looking for their foothold in the new economy.”

Virginia Governor Ralph Northam cited the state’s “investments in our education and transportation infrastructure” as among the features that made Arlington’s bid “so attractive” to Amazon, while Arlington County Board Chair Katie Cristol noted that “the strength of our workforce, coupled with our proximity to the nation’s capital, makes us an attractive business location.”

Nashville Mayor David Briley attributed Amazon’s investment in the city as “a direct result of the talented workforce and strong community we’ve built here,” and lauded the “quality, high-paying jobs” that the tech giant will be bringing to the city.

The company’s official announcement Tuesday was shortly followed by the news that it has signed a letter of intent to lease a massive 1 million square feet of space at One Court Square, the 50-story Long Island City office tower that will soon be vacated by anchor tenant Citigroup.

Update: This story has been updated to include details from Amazon’s official announcement on HQ2.