Facebook investors are freaking out. They shouldn't be.

The stock fell as much as 19% on Thursday after the company warned that revenue growth will slow as it focuses more on privacy. And that's exactly what Facebook should be doing after the Cambridge Analytica debacle.

Facebook is also taking advantage of its strength to invest more in its Stories feature — the sharing of videos and photos, not just on Facebook but on Facebook-owned Instagram, WhatsApp and Messenger.

Keep in mind that Facebook (FB) shares closed Wednesday at an all-time high just before the company shocked investors with its announcement.

Related: Facebook stock is on track for its worst day ever

BTIG analyst Richard Greenfield wrote in a report Thursday that media executives "should not be rejoicing — they should be afraid, very afraid."

"Facebook is actively choosing to make less money, deprioritizing near-term monetization to drive engagement to even higher levels to capture even more of their 2.5 billion monthly users' time and attention," he wrote.

Translation: Facebook can afford to make moves that will hurt it now because they should pay off down the road. It's a strategy that has worked for Amazon (AMZN) and Google (GOOGL), too.

Mizuho tech analyst James Lee said the shift away from the News Feed and more toward Stories "creates a near-term risk," but that "it's not a structural problem."

Related: Facebook stock plunges and is on track for worst day ever

Investors also shouldn't be all that surprised by Facebook's decision to absorb short-term pain in hopes of a huge long-term gain. It has done just that a couple of times before, and the moves have paid off.

In 2014, Lee noted, investors were worried about Facebook's ability to shift from a predominantly desktop platform to mobile. And in 2016, investors questioned Facebook's ramping up its video investments.

Both times, Facebook had the last laugh.

Despite the big drop Thursday, the stock is up more than 400% in the past five years. That's better than Apple (AAPL) and Google.

The broader market also brushed off Facebook fears. Facebook is one of the largest companies in the world, but investors seemed to think the short-term challenges were limited to it and maybe some other social media companies.

The Dow rose modestly and the S&P 500 was flat as investors cheered positive trade developments from President Donald Trump and European Commission President Jean-Claude Juncker.

Even the Nasdaq wasn't down all that much — less than 1%. And the so-called FANG stocks didn't take much of a hit. Amazon, which will report earnings after the close Thursday, and Google owner Alphabet, which posted stellar earnings earlier this week, were down just 1%.

Facebook's social media rivals Twitter (TWTR) and Snapchat (SNAP) fell only 3%.