Tesla reported a massive loss in the first quarter of 2019 as it struggled to deliver its mass-market Model 3 and faced challenges including a diminished federal tax credit and slowing demand for its vehicles.

The $702 million loss was higher than analysts forecast for the company, slightly less than the figure reported in the same quarter one year ago and a stark departure from two straight quarters of profits. Its $3.7 billion in automotive revenue was $1 billion more than the year-ago figure, on the heels of the release of Tesla’s Model 3, but down 41 percent from what Tesla reported in the fourth quarter. Overall revenue, which includes energy products, was $4.5 billion.

For the first couple of years after Tesla began making its Model 3, the car that is supposed to bring electric vehicles to the masses, it faced production problems that hampered its ability to make enough cars. Now that Tesla seems to have overcome that, it is facing more difficulties delivering cars to customers, and therefore, being able to book a sale.

“This was the most difficult logistics problem I have ever seen, and I have seen some tough ones,” Tesla CEO Elon Musk said on an analyst call.

Reflecting on Tesla’s financial position in the wake of the challenges, Musk said it would be “healthy to be on a spartan diet for a while.”

He said “at this point I do think there is some merit to raising capital," after dismissing the idea last year.

The figures were a troubling sign for investors in a year when Tesla has staked its future on the Model 3, expanding sales to China and Europe and shifting the vast majority of its sales and production from the flagship Model S and Model X SUV to a new model aimed at a wider market of consumers. Tesla is also facing criticism for failing to reliably deliver on its long-promised $35,000 Model 3, production and delivery challenges, and legal battles. Tesla announced cuts to about 7 percent of its workforce in January, and Musk is mired in an ongoing legal battle with the Securities and Exchange Commission over his tweets. Tesla reported $67 million in restructuring and related charges.

The earnings report laid bare the steep challenges Tesla faces in delivering its vehicles and keeping them in customers’ hands. For example, on the Model S and X, Tesla reported a $121 million net loss largely because of vehicle returns under programs such as buyback guarantees.

Tesla said it had “a mismatch between orders and deliverable cars,” citing its high-end Model S and Model X cars in particular.

Tesla said this month that Model 3 deliveries had fallen from 63,150 to 50,900 because of troubles shipping the cars to their overseas destinations. Overall, Tesla said its deliveries fell 31 percent compared to the final quarter of 2018.

Tesla had cited a “massive increase in deliveries in Europe and China” and said the issues arose because it hadn’t delivered the Model 3 in those markets before this quarter. Eventually Tesla plans to relieve that delivery pipeline with a new factory in China, but for now it is limited to its sole Fremont, Calif., production plant.

Yet things are likely to get more complicated soon with the addition of a fourth car: the Model Y. Tesla has yet to deliver its Model Y crossover, but the company said in its earnings report it expected it to “ultimately have higher sales than Model S, Model X and Model 3 combined.”

While Tesla said not to take the delivery figures as an indicator of its overall demand, the company warned that the delivery issues would affect its financial picture. The company said, however, it had “sufficient cash on hand” — $2.2 billion by the end of the quarter. Still, Tesla will likely need an infusion of capital to support an ambitious agenda put forth by its CEO at an investor event Monday.

Tesla announced plans on Monday to launch autonomous ride-hail taxis by 2020. Musk said he expects full self-driving capabilities in Tesla’s cars by next year, and several years later, roving fleets of autonomous Model 3 robotaxis in cities across the country.

Correction: An earlier version of this story misstated Tesla’s automotive revenue in the first quarter, which was $3.7 billion.