Tesla recorded a $139 million profit for the last quarter of 2018, smaller than the $311 million quarterly profit before it, but ended 2018 down nearly $1 billion, the automaker told investors Wednesday.

"Last year was the most challenging year in Tesla history, but also the most successful," Tesla CEO Elon Musk said.

Revenues for 2018 nearly doubled the year before it, boosted by Model 3 deliveries in the U.S. The Tesla Model 3 sold well among luxury cars, outpacing rivals from BMW and others as one of the top-selling luxury sedans available last year.

Tesla reported that it would continue to ramp up Model 3 deliveries worldwide, including Europe and Asia, while U.S. deliveries may decrease slightly in the first three months of 2019. In March, the company has a $920 million debt payment but the company reported nearly $3.7 billion of cash on hand and said it could "comfortably" make the payment.

READ NEXT: Tesla may use new battery supplier for cars made in China factory

Musk told investors that he was cautiously optimistic that the automaker could turn a profit in the first three months of 2019—and could turn a profit for every quarter thereafter. The fourth-quarter profit was the first time the company turned a consecutive quarterly profit in its history.

A new Gigafactory in Shanghai is expected to eventually produce up to 3,000 Model 3s per week by the middle of 2020. Tesla says that both it and its existing Fremont factory, together, could produce up to 10,000 Model 3s each week.

"The factory is going to go like lightning," Musk said.

Musk told investors that the Model 3 Standard Range could be ready for sale by the summer and that the demand for the car was strong, although it may not be affordable for all buyers. Musk hinted that the company may begin leasing Model 3s sometime in 2019.

By the end of 2020, Tesla said it should begin building its Model Y small crossover, most likely at its Gigafactory in Nevada.

Tesla said that when its factory in China begins building cars, it expects that Model 3 production will cost half as much as production in Fremont. It expects that Model Y production will cost even less.

DON'T MISS: More cars, fewer workers in Tesla's latest layoffs

Delivering vehicles is still a hurdle, Tesla said. Last year, the automaker attributed logistical problems to reports that lots full of Model 3s waiting for delivery inflated the automaker's claims of achieving 5,000 Model 3s per week. Critics alleged that unfinished cars were counted by Tesla toward that goal and cars built in a tent at its Fremont factory were flawed.

Tesla didn't address those critics but said it would continue to develop its own delivery network throughout 2019.

Tesla said that cost for production decreased by 65 percent in 2018, 20 percent in the fourth quarter compared to the third quarter of 2018 alone.

(This story will be updated.)