Tesla’s upstart Greenwich franchise has hit a pothole, with the state Department of Motor Vehicles issuing a cease and desist order to the electric car manufacturer on its Connecticut sales.

The DMV says that Tesla is illegally selling cars from a storefront on the town’s main shopping thoroughfare, which the Silicon Valley company refers to as a gallery.

An automotive retailers’ trade association successfully argued that the location — Tesla’s lone showroom in the state — is a car dealership and violates the state law prohibiting direct Tesla sales to consumers in Connecticut.

The flagship store will be allowed to remain open, pending an expected appeal by Tesla of the May 2 ruling to state Superior Court. Tesla must otherwise suspend all business activities at the 340 Greenwich Ave. location until it gets a license for a new dealership from the state, which would require approval of the Legislature.

“The clear intent of Tesla at the Greenwich ‘gallery’ is to provide the company with a means of merchandizing its motor vehicles with the further intent to conclude all activities conducted there in a sale,” the DMV’s hearing officer, William Grady, wrote in the ruling.

A top Tesla executive urged legislators this week to support a bill allowing direct sales of the car in the state — in line with New York and Massachusetts — and accused the Connecticut Automotive Retailers Association of going to extreme lengths to stymie the competition.

“It sent ‘secret shoppers’ to the Greenwich gallery in a failed attempt to trick our local employees into selling them a vehicle,” Diarmuid O’Connell, Tesla’s vice president of business development, wrote legislative leaders. “Despite these fake shoppers’ repeated requests, our employees did not sell them a car or take their order. What our employees did, and what they continue to do, is educate visitors about Tesla, its cars and other products, and broadly about electric vehicle technology and its many benefits. It is a basic constitutional right for Tesla to be able to communicate with Connecticut residents about these topics. Ironically, even this limited non-sales activity is too much in the eyes of CARA, which is seeking to entirely shutter the Greenwich gallery.”

Jim Fleming, president of the 300-dealer automotive trade group, admonished Tesla Thursday and said it is blatantly ignoring the law.

“CARA continues to oppose any attempt to sells cars without using the franchise system,” Fleming said.

Connecticut has emerged as the top expansion market for Tesla, the Palo Alto, Calif., tech giant founded by Elon Musk. Not counting a $35,000 Model 3 that the Silicon Valley company plans to start production on this year, the least expensive Tesla model on the market is $68,000. There are about 1,300 Teslas registered statewide.

The DMV ruled that the business activities at Tesla’s Greenwich flagship store were not substantially different than those conducted by licensed new car dealers.

“The owner advisers received bonuses and commissions tied to the number of ‘gallery’ visitors who later purchased a vehicle, a practiced which stopped at the end of 2016 after the CARA petition was filed,” the ruling said. “The payments to employees were consistent with those employees who operated out of licensed locations.”

Tesla’s supporters say Connecticut is losing out on sales tax revenues on vehicles purchased by residents in New York and Massachusetts, the percentage of which rises from 6.35 percent to 7.75 percent for luxury vehicles over $50,000. They also contend that a regional distribution facility, eyed for Bridgeport, could bring jobs to the state.

Twice before, Tesla bills have stalled in the Legislature after intense lobbying by traditional car dealerships.

“I support the concept,” said Senate Majority Leader Bob Duff, D-Norwalk, who previously shepherded the proposal.

The current version of the legislation is idling in the House and hasn’t reached the Senate.