Tesla posted a narrower-than-expected loss on Wednesday as the electric car maker spent heavily to make gains in Model 3 production in April.

While Tesla continued to burn through cash at a much more rapid pace than the previous quarter to hit its production goals, its burn rate was slower than analysts had expected. But that doesn't put to rest questions about whether Tesla will need to raise more money in the near future.

On a conference call Wednesday, Chief Executive Elon Musk said the company doesn't want to raise additional capital at this time, saying it wasn't needed.

However, Tesla's cash dwindled to $2.7 billion by the end of this quarter. While it trimmed its projected capital expenditures for the year, it still expects to spend $3 billion, down from a prior estimate of $3.4 billion.

Instead, Tesla is banking improved Model 3 production. With these changes, Tesla said it expects it will be profitable in the second half of the year.

Tesla shares were down nearly 5 percent in after-hours trading Wednesday. After the earnings release, the stock was volatile. Initially shares moved higher before reversing. But the decline accelerated during Tesla's earnings call when Musk's exchange with analysts grew tense after he labeled their questions "boring" and cut them off.

Also weighing on the stock is Tesla's plan not to begin production on its Model Y crossover SUV until 2020, after reports in April said the company was targeting November 2019 to start producing the vehicle.

Tesla has been pouring money into improvements at its Fremont, California plant and at its Gigafactory 1.

To increase its Model 3 production rate, Tesla will run the Fremont factory around the clock, according to a leaked email that Musk sent to employees. Adding employees, shifts and paying more overtime to workers has boosted Tesla's costs. Its weekly production rate for the mass market electric sedan went as high as 2,270 in mid-April, and Tesla is still targeting a rate of about 5,000 per week in about two months.

However, Tesla plans to shut down production again in the second quarter for about 10 days. The shutdowns are aimed fixing bottlenecks in order to boost production to new levels.

Tesla had fallen short of its goal to produce 2,500 Model 3 sedans weekly by the end of March, and has repeatedly missed production targets in the past.

"If we execute according to our plans, we will at least achieve positive net income excluding non-cash stock based compensation in Q3 and Q4 and we expect to also achieve full GAAP profitability in each of these quarters," Tesla said in a letter to shareholders.

That assumes Tesla can increase Model 3 production volume to 5,000 units per week and grow Model 3 gross margin "to close to breakeven" in the second quarter then to "highly positive" in the third and fourth quarters, the company said. "Ultimately, the growth of Model 3 and the profit associated with it will help us accelerate the transition to sustainable energy even faster."

The Model 3 is critical for Tesla's success. The car starts at $35,000 but once options are added, the price can easily soar above $50,000.

Tesla is sticking with its long-term gross margin target of 25 percent for the Model 3, but expects margins to be lower in the near future, due to higher labor costs in places where Tesla has pulled back on automation.

In the second quarter, deliveries for Tesla's higher-margin Model S and Model X vehicles are likely to be flat with the latest quarter, because the company is changing its quarterly production pattern to achieve a steadier flow of deliveries to regions around the world. Levels should pick up in the third quarter, the company said.

Tesla does expect revenues for its energy storage business to rise, and gross margins for that business to turn positive in the second half of the year.

In the quarter ended March 31, Tesla's net loss widened to a record $709.6 million, or $4.19 per share, from a loss of $330.3 million, or $2.04 per share, a year ago.

Excluding expenses for stock-based compensation and other items, Tesla lost $3.35 per share, which was narrower than the loss of $3.58 per share a year ago.

Revenue rose to $3.41 billion from $2.7 billion a year ago, and outpaced analysts estimates of $3.22 billion.

Automotive revenue in the latest period rose 19 percent from the prior year, mainly due to Model 3 deliveries and adoption of the new accounting standard.