Elon Musk’s
Tesla posted the biggest quarterly net earnings in the history of the company on
the back of record electric vehicle sales in the summer amid a shortage of
computer chips and other materials.

Tesla
earned a record $1.62 billion in the third quarter, the company announced on
Wednesday. Its old record was $1.14 billion that was set in the second
quarter of this year. The profit was nearly five times larger than the $331
million Tesla made in the same quarter a year ago.

Revenue of
$13.76 billion from July through September also set a record, but it fell short
of Wall Street expectations of just over $14 billion, according to FactSet.

Palo Alto,
California-based Tesla made $1.86 per share, beating analyst estimates of
$1.62. This figure is excluding special items such as stock-based compensation.
 

Some of the
quarterly profit, though, came from selling regulatory credits to other
automakers. Tesla made $279 million on credits during the quarter. Other
automakers buy the credits when they can’t meet emissions and fuel economy standards.

“A
variety of challenges, including semiconductor shortages, congestion at ports, and rolling blackouts, have been impacting our ability to keep factories
running at full speed,” the company said in a statement to shareholders.

“We
believe our supply chain, engineering, and production teams have been dealing
with these global challenges with ingenuity, agility, and flexibility that is
unparalleled in the automotive industry,” the statement added.

Earlier
this month Tesla said it delivered a record 241,300 electric vehicles in the
third quarter even as it wrestled with the shortages that have hit the entire
auto industry
. Previously, Musk has said Tesla kept its manufacturing lines
running largely by finding chips from alternate suppliers and then scrambling
to rewrite some of the software in its cars to ensure all the technology
remained compatible.

Third-quarter
sales rose 72% over the 140,000 deliveries Tesla made for the same period a
year ago.

So far this
year, Tesla has sold around 627,300 vehicles. That puts it on pace to soundly
beat last year’s total of 499,550.

While sales
grew in the third quarter, the average sales price fell 6% because Tesla is
selling more less-expensive Models 3 and Y and fewer pricier Models S and X.

(With AP inputs)