Last week, Tesla (NASDAQ:TSLA) reported a quarterly profit under generally accepted accounting principles (GAAP) for the fourth consecutive quarter. This was a particularly important milestone for the electric vehicle pioneer, as it makes the company eligible for inclusion in the prestigious S&P 500 index. Furthermore, earnings easily beat analysts' estimates.

Tesla delivered this better-than-expected performance despite having its main factory in Fremont, California closed for the first six weeks of the quarter due to a local stay-at-home order. However, it got another huge windfall from selling regulatory credits last quarter -- and this recent source of profit is unlikely to last very long.

Regulatory credits drive Tesla's profit

In the first quarter, Tesla booked $354 million of regulatory credit revenue: up 64% year over year. This accounted for 6.9% of the company's automotive revenue and 5.9% of its total revenue. Considering that Tesla's Q1 operating profit and net income totaled just $283 million and $16 million, respectively, this revenue stream represented the difference between a net profit and a significant loss.

A similar dynamic played out last quarter. Revenue from regulatory credits surged 21% sequentially and 286% year over year, reaching $428 million. That translated to 8.3% of automotive revenue and 7.1% of total revenue. Once again, regulatory revenue was the difference between turning a profit and losing money. Tesla posted an operating profit of $327 million and GAAP net income of $104 million last quarter.

These regulatory credits have been in demand recently, as major automakers haven't been building enough "green" vehicles to meet regulatory requirements in certain regions. Rather than paying the resulting fines or pumping out low-quality electric vehicles at a substantial loss, many automakers have found it more cost-effective to purchase extra regulatory credits from Tesla.

The regulatory credit windfall won't last

Regulatory requirements around green vehicles are steadily becoming more stringent in many regions. For example, in California and other states, zero-emission vehicle (ZEV) targets are ramping up from requiring around 3% of sales to be ZEVs in 2019 to around 8% by 2025. (The exact figures depend on the mix of plug-in hybrids vs. fully electric or hydrogen-powered cars, among other factors.)

As a result, in the short term, demand for regulatory credits is rising. Tesla CFO Zach Kirkhorn estimated on the company's recent earnings call that regulatory credit revenue would roughly double in 2020. (That said, after the big surge in regulatory credit revenue in the first half of the year, Tesla could reach that target with regulatory credit revenue of $205 million in each of the next two quarters: more than 50% less than the $428 million generated in Q2.)

Tesla's surprise second-quarter profit positions it to potentially join the S&P 500
Tesla's surprise second-quarter profit positions it to potentially join the S&P 500 AFP / STR

Moreover, Kirkhorn warned that while sales of regulatory credits would remain strong "for some period of time ... eventually, the stream of regulatory credits will reduce."

This shouldn't be a surprise to investors. After initially focusing their plug-in and EV programs on relatively inexpensive small cars -- which are out of favor with consumers -- major automakers are now betting big on electric SUVs and trucks. This likely represents a better tactic for building EVs profitably and on a great-enough scale to meet increasing regulatory requirements without buying extra credits on the market.

Additionally, a slew of start-ups are bringing new electric vehicles to market over the next year or two. That means there will be more sellers in the regulatory credit markets, likely leading to lower prices.

Relying on unproven business models for future profits

Excluding regulatory credit revenue, Tesla has lost money over the past 12 months. Admittedly, production disruptions have impacted profitability this year, but even without those disruptions, the company would barely be breaking even.

Over time, as Tesla gains scale and newer products like the Model Y become more mature (and thus cheaper to build), margins should improve somewhat. That said, much of the cost savings will likely be offset by price cuts. At current prices -- with most Tesla models costing at least $50,000 "out the door" -- the company's growth opportunity would be severely limited by affordability issues.

Thus, Tesla could have quite a bit of trouble reaching its target of industry-leading low-teens operating margins. Management seems to be counting on a huge new revenue stream from selling software to Tesla owners (particularly for autonomous driving) to achieve this margin structure.

On the conference call last week, Elon Musk said that full self-driving software is "probably worth at least $100,000 per car". Yet there's a good chance that the actual value of the software will be a fraction of that amount. If Tesla can't find a new source of profit to replace the regulatory credit revenue that is likely to recede a few years from now, bulls' hopes for a combination of incredible revenue growth and massive margin expansion may never come to fruition.

This article originally appeared in the Motley Fool.

Adam Levine-Weinberg has no position in any of the stocks mentioned. The Motley Fool owns shares of and recommends Tesla. The Motley Fool has a disclosure policy.