In the first court decision on AB5’s validity, a Los Angeles County Superior Court judge ruled Wednesday that the new California gig-work law does not apply to truck drivers because it is preempted by federal law.

Judge William Highberger wrote that owner-operator truck drivers should not be reclassified as employees under AB5 and the California Supreme Court decision on which it is based. That decision involves delivery company Dynamex, which the court ruled had improperly classified its drivers as independent contractors. AB5 and the Dynamex ruling establish a test that makes it harder for companies to claim that workers are independent contractors.

Many big-rig owners have protested the idea of becoming employees, saying they invested $150,000 or more on their trucks and operate independent businesses. But others, including hundreds of port drivers who have filed labor complaints in California, say they are being exploited when they work as independent contractors — they are saddled with truck payments that are so high that they make almost no money, and they are forced to work long hours for fear of being suspended.

Wednesday’s 18-page decision said that neither AB5 nor Dynamex should apply to truck drivers because of a 1994 federal law regulating interstate commerce that endorses using independent-contractor owner-operators “to increase competition and reduce the cost of trucking services.” Under the Supremacy and Commerce clauses of the U.S. Constitution, uniform rules should apply in all 50 states, Highberger wrote.

He cited a New Year’s Eve temporary restraining order granted by a federal judge restricting California from applying AB5 to the trucking industry. That order was granted in a lawsuit filed by the California Trucking Association against the state. As a temporary order, it does not have the force of Highberger’s ruling. A Jan. 13 hearing in that case will consider whether to grant a preliminary injunction while the case proceeds.

Veena Dubal, a law professor at UC Hastings who advocates employee status for gig workers, said the decision seems like an outlier and predicted it would be overturned on appeal. She contrasted it with other cases that found that requiring minimum wage for truck drivers, or using the AB5/Dynamex test, is not preempted by federal law because it has little effect on prices, routes or services.

“Holding that providing basic employment protections to truckers interferes with trucking prices not only flies in the face of established Ninth Circuit precedent, but also, as a social and economic matter, it has untoward moral implications for the regulation of work more broadly,” she wrote in an email.

Wednesday’s order responds to a lawsuit filed by the Los Angeles city attorney against NFI Industries and its subsidiaries CMI Transportation, K&R Transportation California and Cal Cartage Transportation. The case alleges that the companies had exploited drivers at the ports of Los Angeles and Long Beach by classifying them as independent contractors when they should be employees.

The drivers sometimes earned literally pennies a week and were heavily controlled by the companies, City Attorney Mike Feuer said in a news release when the case was filed in 2018.

Los Angeles Mayor Eric Garcetti had supported the case.

“The Port of Los Angeles is one of America’s most powerful economic engines, and the workers who keep it running every day deserve better than to be deprived of basic employment protections,” he said in a statement two years ago.

Feuer said Thursday that he plans to appeal.

“As the Court itself stated, ‘there are substantial grounds for difference of opinion,’” he said in a statement.

Filed a few months before the Dynamex decision, the case originally referred to a previous, less-stringent test for employee misclassification known as Borello. Highberger’s findings about AB5 and Dynamex do not spell the end for the case. Instead, it can proceed under the Borello standard, he wrote.

In contrast to Highberger’s ruling, in January 2019, the California Labor Commissioner ruled that Cal Cartage had misclassified port truck drivers.

And, despite his order, Highberger wrote that the legal landscape would benefit from an appeals court weighing in on the pertinence of AB5 and the Dynamex decision to the trucking industry.

The question of whether federal laws preempt the employment test established by Dynamex and AB5 is “a controlling question of law as to which there are substantial grounds for difference of opinion, appellate resolution of which may materially advance the conclusion of the litigation,” he wrote.

The trucking companies’ attorneys hailed Highberger’s order.

“Independent owner-operator truck drivers have been a vital part of the trucking industry, and a path to achieving the American dream, for many decades,” said Joshua Lipshutz of Gibson Dunn in a statement. “Judge Highberger’s decision confirms that California cannot simply eliminate that business model and force truck drivers to be employees. This is a win for trucking companies and independent truckers nationwide.”

Assemblywoman Lorena Gonzalez, D-San Diego, author of the AB5 law, was not available for comment. But previously she has said that the trucking industry is riddled with misclassification.

Carolyn Said is a San Francisco Chronicle staff writer. Email: csaid@sfchronicle.com Twitter: @csaid