Tesla reported Wednesday a profit of $139 million, or $0.78 a share, and better-than-expected sales, yet failed to meet analysts’ expectations for earnings in the fourth quarter. Shares fell after the markets closed and are down 1.7 percent as of 2:30 pm PT.

Tesla has managed to string together two profitable periods in a row thanks to sales of the Model 3 and despite several headwinds in the fourth quarter, including a non-cash charge of $54 million attributable to non-controlling interests, higher import duties on components from China, a price reduction for Model S and Model X in China and the introduction of a lower-priced mid-range version of Model 3.

In October, Tesla reported its first profit after seven consecutive quarters of losses. It was only the third time in its history that it had achieved this milestone.

Tesla’s profitable fourth quarter lies in stark contrast to its financial position in the same period last year when it reported a loss of $675 million, or $1.75 a share.

Perhaps just as important as the automaker’s income is its cash position. Tesla reported that its cash position improved by $1.45 billion despite the scheduled repayment of a $230 million convertible bond in the fourth quarter.

“We have sufficient cash on hand to comfortably settle in cash our convertible bond that will mature in March 2019,” the shareholder letter to investors said.

Here are a few of the highlights:

Tesla’s Q4 revenues were $7.2 billion, up from $6.8 billion in the third quarter

Tesla’s Q4 operating cash flow less capital expenditures improved to $910 million

Cash and cash equivalents increased by $718 million to hit $3.7 billion at the end of the fourth quarter

Model 3 production volumes in Fremont should reach a sustained rate of 7,000 units per week by end of 2019

Analysts took a measured tone in reaction to Tesla’s fourth-quarter earnings report, noting the company’s accomplishments as well as the challenges that lie ahead.

“Things really aren’t going to get any better for Tesla in the U.S. than they did at the end of 2018,” Jessica Caldwell, executive director of industry analysis at Edmunds, said in an emailed statement. “Turning a profit, creatively addressing production challenges and getting the Model 3 to the masses were huge milestones, but keeping up this momentum is going to be virtually impossible. Tesla’s product lineup is starting to get stale, and now thanks to the elimination of the federal tax credit, buying one has never been more expensive. While there’s still a cool factor to owning a Tesla, it may not be enough to convince buyers to choose one over brand new models from Audi, Porsche and Jaguar. Tesla’s in an awkward purgatory between being a startup and a mainstream automaker, and the biggest open question heading into 2019 is where the company really goes from here. Tesla is used to owning the spotlight, but for the next year we might see a lower-key Tesla as the company takes baby steps to keep things moving along while it plans for the future.”

The challenges will be for Tesla to improve, or at least maintain, margins even as the federal tax credit continues to wind down.

Looking ahead

Tesla is forecasting that Model 3 volumes will “grow substantially” in 2019 due to a full year of high production rates at its facility in Fremont, California.

Tesla said it plans to start producing Model 3 vehicles at its “gigafactory” in Shanghai by the end of the year. The automaker says they intend to slash the cost of producing Model 3s at the factory in China, a bold prediction that if successful will help boost margins.

“We expect the capital spend per unit of capacity for this factory to be less than half of that of our Model 3 line in Fremont,” the company said.

Tesla is also targeting cost reductions in the U.S and expects operating expenses will grow by less than 10 percent in 2019. The automaker says that restructuring actions taken in the first quarter — which includes layoffs that occurred this month — will reduce costs by about $400 million annually.

Tesla’s first-quarter financials will reflect a one-time restructuring cost, the company forecasted.

As a result, Tesla says it’s remaining optimistic that it will post a small profit in the first quarter if it can successfully keep costs down and handle logistics and delivery challenges in Europe and China.

Tesla reported January 2 that it delivered 90,700 vehicles during the fourth quarter, just shy of what analysts expected. The company said at the time that it delivered 13,500 Model S sedans, 14,050 Model X SUVs and 63,150 Model 3s.