SAN FRANCISCO — A Tesla owner has filed a lawsuit against the electric vehicle maker, claiming the company limited the battery range of older vehicles via a software update to avoid a costly recall to fix what plaintiffs allege are defective batteries.

The lawsuit filed on Wednesday in Northern California federal court alleges fraud and seeks class action status for potentially "thousands" of such Model S and X owners around the world who have seen the range of their older-generation batteries suddenly curtailed, some by as much as 40 miles (64 km).

The lost range has been a hot topic since May on online owner forums, such as TeslaMotorsClub.com, in which many owners detail how their battery range has fallen. Users say Tesla has taken away range for which they paid extra money via the software update, thereby devaluing the car, limiting the distance they can travel and forcing them to recharge more frequently.

Plaintiff David Rasmussen's 2014 Model S 85 lost battery capacity equivalent to about 8kWh, but was told by Tesla the degradation was normal, the lawsuit says.

Tesla did not immediately respond on Thursday to requests for comment.

In May, after a Model S caught fire in Hong Kong, Tesla said that out of an overabundance of caution it was revising charge and thermal management settings on Model S and X vehicles via an over-the-air software update. The goal was "to help further protect the battery and improve battery longevity," it said.

A month later, Tesla said only a small group of owners was affected by the range reduction and said it planned to improve the impact of the software update, while cautioning that charging behavior was based on a variety of factors.

Some owners who have seen their cars no longer able to charge to 100% have sought redress through arbitration, while at least three have sold their cars, according to Teslamotorsclub.com forum posts. Others have disabled their Wi-Fi to avoid any software updates that could affect their range.

"Under the guise of 'safety' and increasing the 'longevity' of the batteries of the Class Vehicles, Tesla fraudulently manipulated its software with the intent to avoid its duties and legal obligations to customers to fix, repair, or replace the batteries of the Class Vehicles, all of which Tesla knew were defective, yet failed to inform its customers of the defects," wrote the lawsuit.

The lawsuit points to a recent spate of Tesla battery fires, and claims that instead of informing its customers about a potential fire risk, the company "chose to go behind the backs of its customers and use software updates and throttling of the battery to avoid liability."

In its Vehicle Safety Report published on its website, Tesla says vehicle fires are "exceptionally rare" and from 2012 to 2018 there was approximately one Tesla vehicle fire for every 170 million miles traveled. It compares that with data from the National Fire Protection Association and the U.S. Department of Transportation showing a vehicle fire for every 19 million miles traveled in the United States. Those entities measure fires in all vehicles, not just Teslas.

In May, Tesla said its vehicles were 10 times less likely to experience a fire than a gas car. It said that in its investigation of the Hong Kong fire, it found that only a few battery modules were affected and the majority of the battery pack was undamaged.

One owner, Nick Smith of Orlando, Florida, said in an interview he has been frustrated by poor customer service by Tesla, with sluggish response to his calls and emails and being kept in the dark over the true root of the problem and what will be done to remedy it.

"It's as if you take your car to the shop and you have a 20 gallon tank but now you have a 10 gallon tank without your knowledge or permission," Smith said in an interview.

Smith's 2013 Model S P85 will no longer charge past 90% following the software update. Tesla told him the loss was due to normal regular battery degradation, he said.

The batteries in question carry an eight-year warranty.