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.

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.