Facebook Inc on Wednesday reported slower user growth, revenue that fell short of analysts’ expectations and increased spending to safeguard data, which cut into its profit margin in the second quarter and sent shares down 7 percent after hours.

The company had cautioned investors to expect a big jump in costs because of efforts to address concerns about poor handling of users’ privacy and to better monitor what users post. Total expenses in the second quarter surged to $7.4 billion, up 50 percent compared with a year ago.

Growth in new users slowed with Facebook adding 11 percent more daily and monthly active users on the main Facebook app in the second quarter, compared with 13 percent in the first quarter.

A data privacy scandal involving the political consulting firm Cambridge Analytica and misinformation on WhatsApp contributing to mob killings in India have added to the pressure on Facebook to re-evaluate how its services maintain security and decorum.

The Cambridge Analytica scandal prompted several apologies from Chief Executive Mark Zuckerberg and generated calls for users to desert Facebook, which has grown strongly since launching as a public company in 2012.

Facebook’s revenue grew at its slowest pace in almost three years. Sales grew 14 percent to $13.2 billion in the second quarter compared with $9.3 billion a year ago.

Shares in Facebook, which have risen about 23 percent this year, fell 7 percent to $201.40 in trading after the bell.

The company reported $5.1 billion in profit, or $1.74 per share, compared with the average estimates of $5.1 billion and $1.72 per share among research gathered by Thomson Reuters.

Its operating margin fell to 44 percent from 47 percent a year ago.

Daily user growth for Facebook’s namesake service has slid in six straight quarters, bringing it to 1.47 billion users in the second quarter from 1.23 billion at the end of 2016 when it became embroiled in political issues.

Instagram has grown to 1 billion monthly users from 600 million in late 2016, while Facebook’s two messaging apps, Messenger and WhatsApp have each reported well over 1 billion monthly users.

Instagram is expected to account for 18 percent of Facebook’s revenue this year and 23 percent next year, according to research firm EMarketer.

Nearly all of the services have received greater scrutiny since U.S. intelligence agencies in January 2017 revealed that organizations tied to the Russian government had seeded content on the platform to shake up the 2016 U.S. presidential election.

The new General Data Protection Regulation in the European Union forced several changes to Facebook’s privacy terms and sign-up process. Analysts said the law contributed to the company losing 3 million daily users in the EU during the second quarter, the first time it has seen such a dip.

The threat of additional regulatory setbacks remains a concern, according to analysts.

Facebook suffered a blow in China on Wednesday when regulators there withdrew their approval of a company innovation hub to support local startups, the New York Times reported on Wednesday, citing a person familiar with the matter.

For advertisers, though, Facebook and Instagram are performing as well as ever. Advertising systems on WhatsApp and Messenger remain in the trial phase.

Cowen & Co analysts found 37 percent of ad buyers they surveyed increased spending on Instagram in the first half of this year.

The biggest chunk of online advertising budgets tend to flow to the services with the most data on their users and the broadest set of users in terms of age. That has left Facebook as a leader alongside Alphabet Inc’s Google search engine and YouTube video service.


Reporting by Munsif Vengattil in Bengaluru and Paresh Dave in San Francisco; Editing by Patrick Graham and Lisa Shumaker