Image copyright Reuters

Facebook shares tumbled by more than 20% on Wednesday after the social media network's revenue and user growth fell short of investor expectations.

The firm, which is facing backlash for its handling of fake news and privacy, said it had 2.23 billion monthly active users at the end of June.

This was up 11% on June 2017, the slowest growth in more than two years.

It also warned investors that spending growth would outstrip revenue gains in 2019, pinching profits.

Facebook said it expected revenue gains to slow, as people make use of new options to limit advertising and less profitable overseas markets drive growth.

The firm also plans to spend billions to improve the way it monitors content, tracks advertisers and treats user data - areas where it has faced regulator scrutiny.

The firm, which owns Instagram and WhatsApp, is also investing in new features, such as virtual reality and video.

Shares in Facebook initially fell about 12% in after-hours trade in New York, but losses accelerated as the firm outlined its spending plans.

Daniel Ives, chief strategy officer at GBH Insights, said the firm's forecast was "nightmareish".

"They gave a very disappointing outlook for the second half of the year and 2019 and that's going to significantly weigh on the stock in the near term," he said.

Image copyright Reuters Image caption Facebook boss Mark Zuckerberg has appeared before regulators this year

Analysis

Dave Lee, BBC North America technology reporter, San Francisco

This is hardly Armageddon for Mark Zuckerberg.

On the whole, people are apparently not deserting Facebook. Monthly active users - ie those who interact at least once a month - were steady in the US, down ever-so-slightly in Europe, and up everywhere else.

But for a company used to growing those numbers handsomely throughout the year, a lack of meaningful growth will cause concern, if not panic.

Sadly the company doesn't break down its Europe numbers into anything more granular - which means we can't see the effect the Cambridge Analytica scandal had on British users.

Analysts tell me they consider Cambridge Analytica a "blip" in Facebook's history, though another quarter like this one would be even more impactful than what we saw during Wednesday's after hours trading.

During its earnings call, Facebook warned investors to brace themselves: it doesn't expect revenue growth to improve for at least the rest of this year.

Facebook profits in the quarter were $5.1bn, up 31% from the same period in 2017.

Revenue was $13.2bn, up 42% year-on-year, but expenses grew even faster, rising 50% to about $7.4bn.

User growth has flattened in the US and Canada, key markets for the company due to the high prices ads there command.

The number of EU users fell amid the rollout of tighter privacy regulations, though Facebook continued to attract new users in countries like Indonesia.

Mr Ives said the popularity of Instagram should help Facebook to blunt fallout from challenges at its namesake network.

In February, the research firm eMarketer estimated that the number of Facebook users under the age of 25 would fall by about 2 million this year.

But it forecast that Instagram, which is owned by Facebook, would add about 1.6 million users in that age range in 2018.