WASHINGTON — Amazon.com Inc's planned second headquarters in northern Virginia cleared a key test on Saturday when local officials approved a proposed financial package worth an estimated $51 million amid a small but vocal opposition.

Amazon in November picked National Landing, a site jointly owned by Arlington County and the city of Alexandria, just outside Washington, along with New York City for its so-called HQ2 or second headquarters. That followed a year-long search in which hundreds of municipalities, ranging from Newark, New Jersey, to Indianapolis, competed for the coveted tax-dollars and high-wage jobs the project promises.

Amazon in February abruptly scrapped plans to build part of its second headquarters in the New York borough of Queens after opposition from local leaders angered by incentives promised by state and city politicians.

The five-member Arlington County Board voted 5-0 in favor of Amazon receiving the financial package after a seven-hour meeting held in a room filled with up to about 150 citizens and representatives from local unions and minority advocacy groups.

There was strong opposition from some residents and labor groups, many of whom chanted "shame" and waved signs with slogans including "Don't be the opposite of Robinhood," "Amazon overworks and underpays," and "Advocate for us and not Amazon." One protester was escorted out of the meeting by police.

A few dozen protesters outside the county office chanted, "The people united will never be defeated."

Danny Candejas, an organizer for the coalition "For Us, Not Amazon," which opposes the company's move into the area, said: "We are fighting to make sure people who live here are not priced out by wealthy people."

Some supporters in the meeting held up signs saying "vote yes" and "Amazon is prime for Arlington."

One hundred and twelve people were registered to speak, an unusually high number for a local county meeting, forcing board chair Christian Dorsey to cut the speaking time to two minutes, from three, for every regular speaker, and to four minutes, from five, for representatives of organizations.

Many speakers who were opposed to the Amazon headquarters especially opposed direct incentives, citing rising housing costs, the likely displacement of low-income families, accelerated wage theft for construction workers, and lack of investment guarantees in affordable housing funds.

"Speculators are already driving up home prices, landlords are raising rents and general contractors are raising their quotes for home improvement projects," said one resident, Hunter Tamarro.

Unions including the AFL-CIO objected to Amazon not signing a project labor agreement with wage and benefit safeguards for workers hired to construct the new buildings.

But supporters such as resident June O'Connell said Amazon's presence would ensure Arlington is allocated state funds for investments in transportation and higher education. "I want that money from the state," O'Connell said. "Without Amazon, we wouldn't get a penny of it."

Holly Sullivan, Amazon's worldwide head of economic development, spoke briefly and said the company will invest approximately $2.5 billion, create more than 25,000 jobs with an average wage of over $150,000, which will generate more than $3.2 billion in tax revenue.

"Regarding incentives, Amazon is only eligible for the financial incentive after we make our investments and occupy office space in the community," she said.

Dorsey, the board chair, had said before the vote that he expected the measure to pass. He said that rejecting Amazon would not solve the community's problems and concerns, and that this was the first deal the county has struck where new revenue growth will be used to fund it.

To be sure, the vote approved an estimated $51 million, a fraction of the $481 million promised by the county. Only 5 percent of the incentives are direct. Also, Amazon has been offered a $750 million package by the state that the Virginia General Assembly approved with little opposition.

The $51 million includes a controversial direct financial incentive or cash grant of $23 million to Amazon over 15 years, which will be collected from taxes on Arlington hotel rooms. The grant is contingent upon Amazon occupying six million square feet of office space over the first 16 years.

Arlington has also offered to invest about $28 million over 10 years of future property tax revenue in onsite infrastructure and open space at the headquarters site.

A filing on the county board's website says the $23 million grant and the $28 million in strategic public infrastructure investments were "instrumental in Amazon choosing Arlington for its headquarters."