Amid a topsy-turvy month of mostly bad news for Tesla, the company got one major reprieve on Monday.

According to a Reuters report, a federal court in San Francisco has dismissed a lawsuit  from shareholders over delays in Model 3 production.

The suit against Tesla and its CEO, Elon Musk, claimed that production forecasts for the Model 3 were inflated and deceptive, leading investors to put money into Tesla based on forecasts that proved unrealistic.

DON'T MISS: Tesla's CEO Elon Musk announces company will stay public, abandons private push

In throwing out the lawsuit, Federal District Judge Charles Breyer said, "federal securities laws do not punish companies for failing to achieve their targets.”

The delays have been a key argument for Tesla's critics and stock-market short-sellers who claimed that Tesla's forecasts were deceptive.

The production delays have been financially painful for Tesla, which needs revenue from Model 3 sales to balance its books and begin paying off debt. In a call with investors last month, Musk called Model 3 production a "bet the company" decision.

READ THIS: Report: SEC investigating Musk tweet about taking Tesla private

The lawsuit was separate from more recent suits related to Musk's Tweet on Aug. 7 that he had "funding secured" to take Tesla private, which also triggered an SEC investigation.

On Friday, Musk backtracked on that announcement and said that the company would remain public.

The judge said the plaintiffs had failed to make their case that Tesla executives should have known that the company's production facilities were not up to the challenge of producing 5,000 Model 3s a week.

The ruling, dated Aug. 24 was unsealed on Monday. The judge said the plaintiffs have until Sept. 28 to amend their complaint.