Tesla has posted its fifth straight quarter of profitability and made a record number of deliveries.

In the third quarter of 2020, the car manufacturer generated $8.771 billion in revenue, thanks in part to $579 million in energy storage sales and $581 million in services revenue. In addition, Tesla sold $397 million worth of regulatory credits to other car manufacturers during the quarter. All up, it made a profit of $331 million.

Read Also: Elon Musk Slashes Tesla Model S Price Twice In A Week To $69,420 To Undercut Entry-Level Lucid Air

Tesla’s earnings were bolstered by a 44 percent increase in global deliveries during the quarter, despite overall U.S. auto sales declining 9.7 percent from 12 months ago due to the ongoing challenges presented by the coronavirus pandemic.

The car manufacturer delivered 139,300 vehicles this quarter, easily beating its previous best of 112,000 from the fourth quarter of 2019. It also built 145,036 vehicles in Q3, significantly more than the 82,272 vehicles that it built in the April-June period of this year.

In a recent letter issued to investors, Elon Musk said Tesla is on target to deliver 500,000 vehicles by the end of 2020. However, this won’t be easy as it will need to deliver 181,650 vehicles in the fourth quarter to make that happen, The Verge reports. Musk admitted that hitting this target will necessitate an increase in Model Y production, as well as a boost in production at the company’s Gigafactory in Shanghai, China.

Tesla added during its earnings report that it should have sufficient cash to fund future products such as the Cybertruck and the all-electric Semi.