(CNN Money) — Tesla’s finances are so dicey that the largest quarterly loss in the company’s history couldn’t bring investors down.

The electric car company said it lost more than $717.5 million in the second quarter. But it ended up with $2.2 billion in cash at the end of June. That meant Tesla had to burn through $430 million worth of its unrestricted cash reserves last quarter.

READ MORE: 25,000 Pounds Of Lake Tahoe Trash To Be Turned Into Eagle Sculpture

Tesla spared no expense to reach its long-sought milestone of making 5,000 Model 3s in a week. But with low cash reserves, investors have worried that Tesla would need to borrow more money to keep the company afloat.

The company said it maintained its level of production, making 5,000 Model 3s in a week multiple times in July. Tesla also said it wants to churn out 10,000 Model 3s per week “as fast as we can.” It expects to produce between 50,000 and 55,000 Model 3s this quarter.

Tesla’s stock was up nearly 5% in after-hours trading.

The Model 3 is Tesla’s first that’s aimed at a more mass-market audience, and it debuted to great fanfare, with thousands clamoring to put down $1,000 reservations for the vehicle.

But analysts have said in recent weeks they thought demand for the Model 3 might be waning because of long wait times. Tesla still hasn’t made any $35,000 base model cars available.

Related: Has Elon Musk lost control of his hype machine?

CEO Elon Musk made the bold promise earlier this year that Tesla would post its first quarterly profit in years this fall, Tesla doubled down on that promise again in a letter to investors Wednesday.

READ MORE: Golden State Warriors Beat Luka Dončić Led Mavericks, Reach Sixth NBA Finals In Eight Years

Many analysts viewed that claim skeptically. Others are more optimistic.

“Based on what we’re seeing in the trajectory of production, we think they will be profitable” later this year, automotive analyst Jamie Albertine told CNBC last month.

Tesla recently laid off about 9% of its staff. Musk explained in June that the job cuts were part of a restructuring plan to eliminate “duplication of roles” and added that the layoffs should reduce costs and help the firm on its path to profitability.

Related: Tesla’s magic is wearing off as Model 3 excitement dwindles

Wednesday’s earnings report also comes as Musk has faced scrutiny for recent erratic behavior.

Earlier this month, he made an unfounded criminal accusation about one of the rescuers who helped save a group of young boys and their soccer coach from a flooding cave in Thailand.

During May’s conference call with analysts, Musk’s behavior was bizarre. He told analysts them their questions were boring, and spent a significant amount of time fielding questions from a YouTuber.

Tesla’s stock has fallen more than 13% over the past six months.

MORE NEWS: Gun Control Or Mental Health Reform? UC Davis Researchers Say We May Be Focusing On Wrong Problem

™ & © 2018 Cable News Network, Inc., a Time Warner Company. All rights reserved.