Tesla Inc. (TSLA) - Get Tesla Inc Report shares saw their biggest decline in almost year Thursday -- wiping out some $6.4 billion in value -- after the clean-energy carmaker posted a much-wider-than-expected second quarter loss and said it chief technology officer was leaving the company.

Tesla said it recorded a loss of $1.12 per share over the three months ending in June, a figure that surprise analyst after the company had announced record deliveries -- including 77,634 units of its flagship Model 3 sedan -- for the period earlier this month. Group revenues also trailed estimates, even as they grew nearly 60% from last year to reach $6.35 billion, but a 1.7% fall in the group's gross margin, which was pegged at 18.6%, indicated that volume and revenue growth won't immediately translate into near-term profits.

Image placeholder title

Tesla, however, said it would be free-cash flow positive in the current quarter, with "positive GAAP net income in Q3 and the following quarters," and noted it still expects to meet its previous target of annual deliveries in the region of 360,000 to 400,000 units.

"It's sometimes hard for people to appreciate when you have a large manufactured item with a complex double supply chain, just how difficult that is," Tesla CEO Elon Musk told investors on a conference call late Wednesday when speaking about the company's record delivery total of 95,000 cars. "I'm incredibly proud of the Tesla team for being able to do that."

TheStreet Recommends

"It's a very important milestone, and I think we believe Tesla has - is now at the point of being self-funding, and we expect to be free-cash flow positive in future quarters with the possible temporary exceptions around the launch and ramp of new product," he added. "From a profitability standpoint, we expect to be probably around breakeven this quarter and profitable next quarter, so that's -- I feel pretty confident about that."

Tesla shares fell 13.6% Thursday to close at $228.82 each -- the biggest single-day percentage decline since Sept. 28 -- and extend the stock's 2019 decline to around 31%.

Tesla has an opportunity for continued growth, and is well ahead of other OEMs in electrification and software. Yet for Tesla to be more than niche, one of the core challenges will be for Tesla to improve its gross margin profile," said Credit Suisse analyst Dan Levy, who carries an "underperform" rating on the stock with a $189.00 price target. "The 2Q print showed us that while the Tesla's growth outlook is unchanged, there are nevertheless challenges along the way."

Tesla's J.B. Straubel, a long-time associate of Musk's credited with developing the carmaker's battery technology and co-founding the company, will leave the company but continue to advise Musk in an unofficial capacity.

"I want to thank J.B. for his fundamental role in creating and building Tesla," Musk told investors on the conference call. "If we hadn't had lunch in 2003, Tesla wouldn't exist, basically."