Tesla reported that it earned a $3.3 billion profit in the first quarter of 2022. Tesla turned that profit on just over $18.7 billion in revenue, the company announced. That represents an 81 percent increase year over year, compared to $10.4 billion in revenue in Q1 2021.

The company logged $679 million in emission credit sales to other automakers, compared to $314 million in credit sales in Q4 2021. The company generates this revenue by selling these credits to automakers that make fewer “clean” vehicles than are required by the US government and the European Union.

The credit sales have come in handy in past years, helping Tesla eke out a profit while its car-making business struggled. Last summer, the company reported that its manufacturing and energy sales business was profitable for the first time without counting emission credit sales.

It was undoubtedly a noteworthy quarter for Tesla. The company opened two new factories — one in Berlin on March 22nd and the second in Austin, Texas, on April 8th — while also being forced to shutter its Shanghai factory for several weeks amid rising COVID numbers. The costs of opening those two factories, while also struggling to keep its Chinese factory in operation, were expected to weigh down Tesla’s numbers this quarter.

The company says it started production in Berlin last month, and that it started Model Y deliveries from Texas in April. The company also mentioned it’ll produce its structural battery packs with 4680 cells in Texas later this year, alongside the standard packs with 2170 cells.

Author