For the last four months, most Facebook investors have had a simple thesis about the company’s prospects: Facebook makes so much money that it would barely notice the costs associated with better policing its platform for fake news, hate speech, fake accounts, and election manipulation. Facebook’s stock cratered in March on news of the Cambridge Analytica scandal, but had risen 43 percent since.

It turns out, as Facebook disclosed in financial results Wednesday, that Wall Street was very, very wrong about that. Investors freaked out, driving Facebook’s stock down roughly 20 percent in after-hours trading, erasing more than $120 billion from the company’s valuation.

In announcing results for the second quarter, Facebook said that not only will it cost much more to harden the platform than Wall Street was expecting, but also that it expects revenue growth to slow through at least the end of 2019. Translation: Facebook will be a much less profitable company for the next several years.

Facebook’s stock has proven impervious to all manner of bad news, so it may quickly rebound. But the news also left little room for anyone doubting how serious the company is about restoring its reputation as a force for good. Founder and CEO Mark Zuckerberg has said that he has no intention of letting Facebook become a platform known for celebrating humanity’s worst impulses. It appears he plans to put more money than anyone expected behind that pledge.

How much less profitable will Facebook be? During the last quarter of 2017, the ratio of operating earnings to revenue—an important measure of profitability—was 57 percent. It was 44 percent in the second quarter of 2018. And it’s expected to fall into the mid-30 percent range by the end of this year, said David Wehner, Facebook’s chief financial officer.1

Dating back to the end of last year, investors had expected Facebook to spend roughly an additional $1 billion annually to buttress its platform. But Wehner suggested that the investments in safety and security will be much more, amounting to “billions of dollars per year,” and helping to drive up Facebook’s expenses 50 percent to 60 percent this year. Wehner hinted that those trends would continue. In 2019, he said, expenses would grow faster than revenue, meaning profit will shrink.

Even more shocking to investors was the projected slowdown in revenue growth. Facebook stressed that its advertising business remains incredibly healthy. It said that the price per ad on its platforms increased 17 percent during the quarter, a sign of strong demand.

The problem is that advertising revenue is a function of both the price per ad and the number of ad impressions. And user growth in the US and Europe—the markets where Facebook can charge the most for ads—has flatlined. Facebook gets 70 percent of its ad revenue from those two regions. Facebook said its monthly average users in the US of 241 million didn’t grow at all, and that monthly average users in Europe actually fell slightly to 376 million from 377 million.

The decline in Europe, according to Facebook, was partly because of new privacy rules, known as the General Data Protection Regulation, or GDPR. But the bigger issue is that Facebook, and to an extent Instagram, have saturated those markets, leaving few potential new users. Facebook’s monthly average users are now 97 percent of the adult population in the US and more than 90 percent of adults in Europe.

Facebook says it believes Facebook Messenger and WhatsApp are showing promise as new platforms for advertisers. But COO Sheryl Sandberg says that she doesn’t see them contributing meaningfully to Facebook’s bottom line for a few more years.