Amazon will benefit from government subsidies and investments totaling more than $2.4 billion from Virginia, New York and Tennessee to build its new facilities, spurring complaints that taxpayers shouldn’t be subsidizing one of the nation’s most prosperous companies.

A big gap in the size of incentives promised by New York and Virginia also stirred concern in the Empire State — and quiet satisfaction in the Old Dominion — that Richmond had cut a better deal than Albany. In the largest single subsidy offered by each state, New York offered tax credits equal to $48,000 per new job, while Virginia agreed to workforce cash grants of $22,000 per job.

The incentives packages also worried affordable housing activists that too little was promised to deal with the potential effect on housing costs of an influx of tens of thousands of new employees with an average salary of more than $150,000 a year.

It’s normal for job-hungry state and local governments to offer tax credits, grants and other incentives to lure companies, and the contest for Amazon’s second headquarters, HQ2 — widely seen as the biggest economic development prize in a generation — was no exception.

But the prospect of granting hundreds of millions of dollars of subsidies to a company led by the world’s richest man — Amazon CEO and founder Jeffrey P. Bezos — also drew condemnation in some quarters. (Bezos owns The Washington Post.)

Two New York lawmakers representing constituents in Long Island City, where one of the two new Amazon headquarters will be located, have pledged to oppose the deal.

“We are witness to a cynical game in which Amazon duped New York into offering unprecedented amounts of tax dollars to one of the wealthiest companies on Earth for a promise of jobs that would represent less than 3% of the jobs typically created in our city over a 10 year period,” state Sen. Michael Gianaris and City Council Member Jimmy Van Bramer said in a joint statement issued after the announcement.

The total of incentives for Amazon — including direct subsidies and public investments designed to help attract the company — appeared to be considerably less than the package of up to $8.5 billion offered by Maryland and $7 billion by New Jersey. That suggested that factors such as access to talent and airports, and overall business climate, were more important for the company.

New York was the most generous among the winners, promising more than $1.5 billion in direct subsidies for Amazon provided it creates at least 25,000 jobs in Long Island City, which is in Queens across the East River from Midtown Manhattan.

Virginia appeared to have made a better deal, as the state and Arlington County offered direct subsidies of $573 million for 25,000 jobs to place the other new headquarters near Reagan National Airport in what will now be called National Landing.

Virginia and Arlington also pledged investments totaling $223 million for transportation improvements including upgrading two Metro stations — an incentive that will help Amazon and the rest of the community.

Most of the incentives are conditional on Amazon delivering the 25,000 new high-paying jobs. The promised salary of $150,000 a year is an increase from the $100,000 salaries that Amazon originally guaranteed. Both New York and Virginia offered additional subsidies if the company creates more than 25,000 jobs.

Nashville, a surprise last-minute addition to Amazon’s plan, promised $102 million in subsidies for a new operations center with 5,000 jobs.

In describing its rationale for picking Northern Virginia and New York to share the top prize, Amazon stressed that access to tech talent was paramount.

“We were looking for a location with strong local and regional talent — particularly in software development and related fields,” the company statement said.

Talent would not necessarily explain the choice of Northern Virginia over Maryland’s Montgomery County, however, as the two are across the Potomac River from each other and in the same metropolitan area.

However, Northern Virginia is widely seen as more business-friendly than Montgomery County, partly because Virginia is a right-to-work state, where it is prohibited to require membership in a union as a condition of employment. Also, Amazon said it wanted good access to airports, and the Arlington site is a half-mile from Reagan National Airport, whereas the Montgomery County site would have been more than a 30-minute drive from that airport.

In Virginia, the bulk of the direct incentives will come in the form of workforce cash grants from the state of up to $550 million, based on $22,000 for each job created over the next 12 years.

The state will also invest $195 million in infrastructure in the neighborhood, including improvements to the Crystal City and Potomac Yards Metro stations and a pedestrian bridge connecting the Amazon site to Reagan National Airport. The Potomac Yards station is not yet open.

From Arlington, Amazon will receive a cash grant of $23 million over 15 years linked to incremental growth of the tax on hotel rooms. The county also will dedicate about $28 million of future property tax revenue for on-site infrastructure and open space at the site.

The Virginia General Assembly will have to approve the Amazon subsidies, but legislators predicted they would win passage. The Arlington County Board will take up the package in February.

Although it is not a direct subsidy, Virginia’s effort to secure Amazon also included an ambitious plan to spend nearly $1.1 billion over 20 years to expand tech higher education in the state. Amazon said this was an initiative by the state and not something that the company proposed.

One aim is to raise the number of bachelor’s and master’s degrees awarded in the computer sciences and related fields by 25,000 to 35,000 over the next two decades, beyond what was already forecast. The plan includes construction by Virginia Tech of a graduate campus focused on innovation in Alexandria, and expansion of George Mason University’s tech program in Arlington.

Virginia Gov. Ralph Northam (D) described the package as “a new model of economic development for the 21st century.”

One provision in Virginia’s package is not financial at all. Virginia agreed to give Amazon at least two days notice if the media or the public filed a Freedom of Information Act request about the agreement. This would “allow the Company to seek a protective order or other appropriate remedy.”

New York’s package included direct state incentives of $1.2 billion, most of which is to be provided via a refundable tax credit equivalent to $48,000 per job over the next 10 years.

New York also offered a cash grant of $325 million based on the square footage of buildings occupied in the next 10 years.

In addition, Amazon will benefit from two other New York City incentive programs, which are available to all companies.

It wasn’t immediately clear why New York had offered so much more in incentives than Virginia. New York Gov. Andrew M. Cuomo (D) defended the incentives by saying that the total state and city revenue is estimated at $27.5 billion, which he said would be about nine times larger than the incentives.

Virginia’s top economic development official, who led negotiations with Amazon, said his state historically has been less generous than others in granting subsidies.

“Virginia is generally a relatively low-incentive state, typically the lowest incentives in the South,” said Stephen Moret, director of the Virginia Economic Development Partnership.

“We wanted to win this in a Virginia way, and that was more about emphasizing our assets, in particular our stable, competitive business climate and our outstanding education systems,” Moret said.

He said that the total incentive package was cut by half when Amazon decided to change its original plan to build a single new headquarters with 50,000 jobs.

But even with the shrinkage in the size of the prize, Moret said, the state estimates that the increased revenue in personal income taxes and sales taxes over 20 years will be so high that the net gain for the state’s general fund will total $3.2 billion after paying the incentives.

“It’s a gusher” of tax revenue, he said.

Affordable housing activists hope that some of that revenue will ultimately go to offset the expected negative effect on rents and home prices. They were displeased that while Virginia and Arlington offered large sums for transportation improvements to deal with congestion, the package did not include any new money earmarked for housing.

“There’s excitement that HQ2 is coming but concern that there is not more than has seemingly been committed for low- and moderate-income folks for housing,” said David Bowers, vice president and Mid-Atlantic market leader for Enterprise Community Partners. “It’s a challenge moment for regional leaders — public and private sector — to determine whether we will proactively make investments at the scale of need to meet the region’s housing affordability challenges.”