In a statement, Tesla said it was pleased with the decision.

“The ruling is a win for consumers who are increasingly looking to purchase electric vehicles,” the company said. “We look forward to continuing to serve our customers and grow our business across the commonwealth.”

The state statute at issue in the legal battle says an automobile manufacturer must sell its cars through independent dealerships in Virginia unless no dealership is available in a community that can do so “in a manner consistent with the public interest.”

Tesla, which was founded by tech industry tycoon Elon Musk, has argued that its direct-to-consumer business model means no independent dealer could sell its cars profitably, and thus no dealer could do so in a manner consistent with the public interest.

Holcomb agreed and granted the company’s petition to open a store, even though a DMV hearing officer had previously recommended that Tesla’s application be denied.

While his ruling upheld Holcomb’s decision, Rupe also expressed “serious concerns about the evidence in this case.”