(Bloomberg) -- Tesla Inc. prevailed in a years-long battle to compete with General Motors Co. and Ford Motor Co. on their turf, with the state of Michigan allowing the electric-car maker to bypass laws against auto manufacturers selling directly to consumers.

While Tesla customers’ sales contracts will have to indicate the transaction took place elsewhere, the requirement is merely a matter of paperwork. The electric-car maker will be allowed to deliver its Model 3, S and X vehicles to buyers without them having to leave the state.

The stipulation issued by Michigan Attorney General Dana Nessel is a major victory for Tesla and blow to dealers and auto manufacturers that have tried to stymie the company in states across the country. It adds to positive momentum that sent Tesla’s market capitalization past GM and Ford’s combined earlier this month. The maker of the Model 3 eclipsed Volkswagen AG on Wednesday to become the second-most valuable carmaker in the world, behind only Toyota Motor Corp.

Tesla filed its federal lawsuit against the state of Michigan in 2016. The following year, the company opened a gallery -- where it has showcased its vehicles, but until now has been unable to sell them -- at a high-end mall in the Detroit suburb of Troy, Michigan. Owners in the state had to travel to Cleveland or Columbus, Ohio, to have their vehicles worked on until the company recently opened a service center in Toledo, near the Michigan border.

The attorney general’s stipulation also allows Tesla to now indirectly own service centers in Michigan through a subsidiary. Chief Executive Officer Elon Musk said in July that expanding Tesla’s repair facility network is key to growing sales.

“You’ve got to have service, you have to have the supercharging and charging all sorted out, good consumer financing, and then the price must makes sense,” Musk said on an earnings call. “Any place where those four things are true, our sales are great. So we’re rolling out service centers like crazy.”

To contact the reporter on this story: Gabrielle Coppola in New York at gcoppola@bloomberg.net

To contact the editors responsible for this story: Craig Trudell at ctrudell1@bloomberg.net, David Welch

©2020 Bloomberg L.P.