A state court has ruled that Tesla cannot issue itself a franchise to sell vehicles directly to consumers in Missouri, a blow to the electric carmaker that wanted to comport with the state's franchise requirement without having to sell cars through an independent dealership.

In a suit brought by the Missouri Automobile Dealers Association, a judge ruled that carmakers cannot issue themselves franchises, which means Tesla will have to stick to selling the vehicles online in Missouri if it wishes to continue its practice of not using a man-in-the-middle car dealership.

The dealers' suit said the state broke the law when it issued a dealer's license to Tesla of Palo Alto, California. That position was supported last week by Cole County Judge Daniel Green. The decision means Tesla can now only showcase its vehicles at its Kansas City and St. Louis locations. Under the ruling, buyers can't purchase them there. They have to go online.

Arizona, Connecticut, Michigan, Texas, Utah, and West Virginia also bar Tesla from direct sales and require carmakers to issue franchises to independent dealers, according to The Wall Street Journal.

Tesla said in a statement that the automaker "will take all appropriate steps in the courts to ensure that Missouri consumers continue to have the right to choose how they purchase their vehicles." Under Missouri law, carmakers are not allowed to directly compete with car dealerships that sell their vehicles.

Tesla has roughly 260 stores and intends to have 441 worldwide by the end of next year.

Meanwhile, Tesla said Wednesday that it is investigating a fatal crash of a Model S in the Netherlands. An investigation could determine whether the Autopilot feature was at fault.