(Reuters) - Facebook Inc FB.O shares rose on Wednesday after the social network reported a surprisingly strong 63 percent rise in profit and an increase in users, with no sign that business was hurt by a scandal over the mishandling of personal data.

After easily beating Wall Street expectations, shares traded up 7.1 percent after the bell at $171, paring a month-long decline that began with Facebook’s disclosure in March that consultancy Cambridge Analytica had harvested data belonging to millions of users.

The Cambridge Analytica scandal, affecting up to 87 million users and prompting several apologies from Chief Executive Mark Zuckerberg, generated calls for regulation and for users to leave the social network, but there was no indication advertisers immediately changed their spending.

“Everybody keeps talking about how bad things are for Facebook, but this earnings report to me is very positive, and reiterates that Facebook is fine, and they’ll get through this,” said Daniel Morgan, senior portfolio manager at Synovus Trust Company. His firm holds about 73,000 shares in Facebook.

Facebook’s quarterly profit beat analysts’ estimates, as a 49 percent jump in quarterly revenue outpaced a 39 percent rise in expenses from a year earlier. The mobile ad business grew on a push to add more video content.

Facebook said monthly active users in the first quarter rose to 2.2 billion, up 13 percent from a year earlier and matching expectations, according to Thomson Reuters I/B/E/S.

The company reversed last quarter’s decline in the number of daily active users in the United States and Canada, saying it had 185 million users there, up from 184 million in the fourth quarter.

The results are a bright spot for the world’s largest social network amid months of negative headlines about the company’s handling of personal information, its role in elections and its fueling of violence in developing countries.

Facebook, which generates revenue primarily by selling advertising personalized to its users, has demonstrated for several quarters how resilient its business model can be as long as users keep coming back to scroll through its News Feed and watch its videos.

It is spending to ensure users are not scared away by scandals. Chief Financial Officer David Wehner told analysts on a call that expenses this year would grow between 50 percent and 60 percent, up from a prior range of 45 percent to 60 percent.

Much of Facebook’s ramp-up in spending is for safety and security, Wehner said. The category includes efforts to root out fake accounts, scrub hate speech and take down violent videos.

FILE PHOTO: Silhouettes of laptop users are seen next to a screen projection of Facebook logo in this picture illustration taken March 28, 2018. REUTERS/Dado Ruvic/Illustration/File Photo

Facebook said it ended the first quarter with 27,742 employees, up 48 percent from a year earlier.

“So long as profits continue to grow at a rapid rate, investors will accept that higher spending to ensure privacy is warranted,” Wedbush Securities analyst Michael Pachter said.

It has been nearly two years since Facebook shares rose 7 percent or more during a trading day. They rose 7.2 percent on April 28, 2016, the day after another first-quarter earnings report.

Net income attributable to Facebook shareholders rose in the first quarter to $4.99 billion, or $1.69 per share, from $3.06 billion, or $1.04 per share, a year earlier.

Analysts on average were expecting a profit of $1.35 per share, according to Thomson Reuters I/B/E/S.

Total revenue was $11.97 billion, above the analyst estimate of $11.41 billion.

The company declined to provide some details sought by analysts. It has not shared the revenue generated by Instagram, the photo-sharing app it owns, and it declined to provide details about time spent on Facebook. Facebook also owns the popular smartphone apps Messenger and WhatsApp.

Tighter regulation could make Facebook’s ads less lucrative by reducing the kinds of data it can use to personalize and target ads to users, although Facebook’s size means it could also be well positioned to cope with regulations.

Facebook and Alphabet Inc's GOOGL.O Google together dominate the internet ad business worldwide. Facebook is expected to take 18 percent of global digital ad revenue this year, compared with Google's 31 percent, according to research firm eMarketer.

The company said it was increasing the amount of money authorized to repurchase shares by an additional $9 billion. It had initially authorized repurchases up to $6 billion.

Facebook shares closed at $185.09 on March 16, the day that the Cambridge Analytica scandal broke after the bell on a Friday. In the days immediately afterward, the company lost more than $50 billion in market value.

The Cambridge Analytica scandal, which has sparked government investigations globally, was mentioned only once on an hour-long conference call between analysts and Facebook management, when one analyst asked Zuckerberg what he learned from testifying in U.S. congressional hearings.

Zuckerberg said the two days of hearings this month were “an important moment for the company to hear the feedback, and to show what we’re doing.”