A state court has ruled that Tesla is illegally selling its electric automobiles from its gallery in Greenwich, despite the company’s insistence that the location is strictly an educational venue.

Connecticut law prevents the direct sale of automobiles from manufacturers to consumers. In May 2017, the state’s Department of Motor Vehicles (DMV) ordered Tesla to “cease all functions” at its 340 Greenwich Ave. location, asserting that the Palo Alto, California-based company was selling automobiles without a dealer license. Tesla sued the DMV in June 2017, insisting that the Greenwich gallery enabled prospective buyers to look at and test drive a Tesla before making a purchase by telephone or the internet, with the automobile delivery taking place outside of Connecticut.

However, Superior Court Judge Joseph Shortall sided with the DMV on this matter. “Because Tesla engages in the business of selling motor vehicles and offering them for sale at the gallery without the required license to do so, its activities there are illegal,” Shortall wrote in his ruling.

Tesla has unsuccessfully tried to lobby the state legislature to change the law on direct sales of automobiles by vehicle manufacturers. Last year, Diarmuid O’Connell, Tesla’s vice president of business development, said the company was considering gallery locations across Fairfield County in Bridgeport, Danbury, Fairfield, Norwalk and Westport, along with other sites in Hartford, West Hartford and New Haven. To date, however, there have been no additional Connecticut galleries beyond Greenwich.

Tesla responded to the judge’s ruling with a statement that said, “Tesla disagrees with the judge’s decision, and we stand by our mission to educate the public and raise awareness about the benefits of EVs because getting more EVs on the road is the right thing to do for the environment and for the battle against climate change.”