Tesla is selling its electric roadsters in downtown D.C. and plans to do the same in Tysons. (Bill Pugliano/GETTY IMAGES)

Tysons Corner serves some of the wealthiest counties in the region (and the country), so it’s little wonder that Tesla Motors, seller of the $70,000-plus Model S electric car, would like to open up shop there.

But it hasn’t been easy.

Founded in Palo Alto, Calif., in 2003, Tesla designs, builds, sells and services its electric cars through stores and service centers in the District, California, Florida, Illinois, New York, New Jersey and elsewhere.

Its Washington dealership, at 1050 K St. NW, opened in 2011. Tesla also has showrooms in Montgomery Mall in Bethesda and Tysons Corner Center, but neither location is permitted to sell cars.

In Virginia, Tesla has been pushing aggressively to change that. The company applied for an exemption to the state’s rule requiring automakers to sell through franchised dealerships so that Tesla could sell its own cars. But last spring, Richard D. Holcomb, commissioner of the Virginia Department of Motor Vehicles, rejected the application.

Tesla chief executive Elon Musk then told Automotive News that he was “pretty upset about the Virginia store.” The company filed a lawsuit.

After negotiations last month between the state, the company and the Virginia Automobile Dealers Association, Tesla has agreed to withdraw its lawsuit and will be permitted to apply for a single license in Northern Virginia.

“Tesla, the Virginia Automobile Dealers Association, and the Department of Motor Vehicles, through counsel, came to an agreement and avoided litigation regarding the operation of a Tesla dealership in Virginia,” said Sunni Blevins Brown, spokeswoman for the Virginia DMV.

She said the automaker still must get a license from the Motor Vehicle Dealer Board to operate as a car dealer, which typically takes a couple of weeks.

Tesla has not announced where it would put its Virginia dealership. The company is “currently evaluating other locations for the store and will continue to maintain the current gallery in Tysons Corner,” Tesla spokesman Patrick Jones said.