Amazon and Arlington County have agreed to buy all the electricity generated from a new Dominion Energy solar power farm, a major step toward fulfilling their promises to rely fully on renewable energy in the coming decade.

The agreement, which Amazon has signed and the Arlington County Board approved by a 5-to-0 vote Tuesday night, would name a 1,500-acre site near the North Carolina border the “Amazon Arlington Solar Farm Virginia.” Beginning in 2022, the farm will be capable of generating about 250 million kilowatt-hours per year, according to Dominion officials.

Amazon will buy about 68 percent of the energy, and Arlington will buy about 32 percent, which equals 83 percent of the electricity used by the county government for its buildings, streetlights, traffic signals, water pumping stations and waste­water treatment.

Amazon is building an East Coast headquarters in the Arlington neighborhood of Crystal City, and the county and the retail giant have pledged to cooperate on issues from affordable housing to infrastructure to the environment. (Amazon founder and chief executive Jeff Bezos owns The Washington Post.)

Dominion will build, own and operate the shared site in Pittsylvania County, said Dianne Corsello, the utility’s director of business development. There will be no charge to other ratepayers. Arlington officials said the project entails no upfront cost from them and should be revenue neutral.

The power generated at the new site, which is now farmland, will go into the regional grid. Arlington and Amazon will get renewable energy credits for their share of the power. The county has been buying similar credits equal to 30 percent of its energy needs. When the new agreement takes effect, Arlington will end those purchases, which cost about $30,000 per year.

“All these kinds of agreements and purchases make solar more viable for everybody,” said Libby Garvey, the County Board chair. “The next step [for Arlington] is going carbon neutral by 2050, and this gives us some breathing room.”

Although the property had earlier been described as “treeless,” between 10 to 15 percent of the land does have trees of varying sizes on it, Corsello said. She told the board Tuesday that Dominion will seek to minimize tree-clearing as the land is developed.

The revelation was not enough to thwart the deal. Garvey called it a “hiccup,” and said if the county wants to be innovative, it has to be willing to accept mistakes. She then asked Corsello to save any “big, beautiful trees” on the property.

The county’s goal is to use 100 percent renewable energy for government functions by 2025 and have county residents and businesses achieve that goal by 2035. The agreement approved Tuesday gets it much of the way there.

A “bigger reach,” Garvey said, is carbon neutrality — which means the county would not release more carbon into the atmosphere (through gas emissions, for example) than it replaces with carbon-consuming products (such as trees).

Virginia’s state government recently purchased a significant amount of energy, mostly from solar farms, from Dominion, which Gov. Ralph Northam (D) called the largest such contract negotiated by any state.

That deal says state agencies will get 30 percent of their electricity from renewable ­sources by 2022. Fairfax County is also moving to buy energy from contractors that would install solar panels on more than 100 county buildings, part of an effort that aims to remove protections against competition given to Dominion.

Amazon said its portion of the deal will power the tech giant’s new headquarters along with other Amazon-owned operations across the commonwealth, including Whole Foods Markets and fulfillment centers. It already has agreements in place with Dominion to buy solar energy on Virginia’s Eastern Shore in Accomack, as well as in nine other locations in Virginia. It has 84 renewable energy projects that are projected to deliver more than 5.5 million megawatt hours of renewable energy annually globally. The company has said its aim is to be net-zero in carbon emissions by 2040.

The Arlington agreement has been in the works since last fall, said John Morrill, the county’s energy manager. The price Arlington will pay for the power is 3.35 cents per kilowatt-hour; the county government would have to cover any differential between that price and what the hourly wholesale power price is.

“Fluctuations in the wholesale price of electricity may cause some months to have net savings and other months to have net expenses,” Morrill wrote in a report to the County Board, which assured them the financial risk was small. “Over the course of a year, these are expected to offset each other and be neutral in the aggregate.”