Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Tesla reported a steeper than expected quarterly loss on Wednesday on higher spending at its vehicle and battery factories, and said adjusted profitability could be within sight if the company meets its delivery goals.

The 13th straight quarterly loss for the Silicon Valley electric car maker underscores the financial hurdles that hamper it while it takes on increasingly ambitious goals - a ten-fold ramp of vehicle production in three years and the recent plan to acquire solar panel installer SolarCity.

Tesla, led by entrepreneur Elon Musk, said it was still on track to deliver about 50,000 new Model S and Model X vehicles during the second half of 2016, and reiterated that it would spend $2.25 billion in capital expenditures in 2016 to prepare for its upcoming Model 3 sedan.

If the company can fulfill those production and delivery goals in the second half of the year, "we've got a great chance of being non-GAAP profitable" Chief Financial Officer Jason Wheeler told analysts on a conference call without specifying a time period.

Tesla reported its first-ever quarterly profit in 2013.

Byers Market Newsletter Get breaking news and insider analysis on the rapidly changing world of media and technology right to your inbox. This site is protected by recaptcha

Shares of the company, which has offered to buy SolarCity for $2.6 billion, were little changed in after-hours trading.

"There's no doubt Tesla will remain the category leader as electric vehicles become increasingly mainstream, but it could be years before the bottom line justifies any investment in Tesla other than a purely speculative one," said James Brumley, an InvestorPlace analyst.

Tesla reported last month it had missed its vehicle delivery target for the second consecutive quarter, raising doubts it would hit its annual target. But Tesla could end the year just shy of its original delivery target of 80,000 to 90,000 vehicles for 2016 if it delivers 50,000 cars in the second half of 2016.

"We were in production hell for the first six months of the year," Musk told analysts during a conference call. "Man, it was hell. And we managed to climb out of hell partway through June and now the production line is humming and our suppliers mostly have their sh*t together."

Musk warned he would fire suppliers and reorganize internal teams who fail to meet a target date of July 1 to begin production of the Model 3, even while acknowledging it will not be possible to meet that date.

The company said it planned to open a new store every four days on average for the rest of the year, including in Taipei, Seoul and Mexico City, but did not disclose the cost.

Tesla said gross margins will improve by 2-3 percentage points in the second half of the year, although adjusted operating expenses will increase for the full year by 30 percent.