Tesla has lost $1.5 billion so far this year, the company said in its second-quarter earnings release. But it still plans to score a profit in the third and fourth quarters.
The electric-car maker's net loss in the second quarter was $742.7 million, a bit better than the $784.6-million loss in the first quarter. The company reported a "slightly positive" gross margin on the Model 3, its new "bet the company" sedan. That compares with a negative gross margin last quarter.
Revenue from sales of all Teslas was up 23 percent, to $3.36 billion.
Analysts had expected second-quarter results to be bad. Musk has told investors to expect positive net earnings and positive cash flow in the upcoming third and fourth quarters.
To reach those goals, analysts agree, Tesla must produce and sell Model 3s at a rate of at least 5,000 cars a week. Cost-cutting is apparently also key; earlier this year, Musk said Tesla will trim back capital spending this year from $3.4 billion to $3 billion.
Tesla's stock price has been sliding recently, but closed Wednesday up 2.7 percent to $300.84, giving the company a market value of about $51 billion.
Musk had said Tesla doesn't need to raise new debt or equity capital for the rest of the year. Bloomberg reported Wednesday that Tesla is searching for a Chinese partner to help finance a planned $5-billion manufacturing complex in China.