SAN FRANCISCO (Reuters) - Facebook Inc said on Wednesday that new rules and product changes aimed at protecting users’ privacy would slow its revenue growth into next year and significantly raise expenses, taking the shine off quarterly revenue results that beat expectations.

The outlook was the latest twist in a day of contrasting news for the world’s largest social media company. Facebook earlier agreed to pay $5 billion to settle a U.S. Federal Trade Commission data privacy probe but then disclosed that the regulator was now investigating it for anti-competitive behavior.

The settlement, which lawmakers and privacy experts criticized as a “slap on the wrist” for a company whose revenues last year topped $55 billion, suggested that Facebook had moved past a major regulatory challenge that has dogged it over the last year.

But Facebook’s chief financial officer, Dave Wehner, warned that operational changes required by the settlement would be costly. In addition, he said, revenue will be hurt by new limits on usage of consumer data being set by governments around the world and by tech companies on whose systems Facebook relies. He did not elaborate.

The guidance demonstrates the lasting effects of Facebook’s failure over the last decade to adequately secure some users’ personal information and inform users how its business partners were accessing the data.

Still, Facebook said the second straight quarter of above-expectations revenue showed that its namesake app is producing growth even as users gravitate toward newer, more private features whose popularity has outstripped their usage among advertisers.

Second-quarter revenue rose to $16.9 billion from $13.2 billion a year ago, beating analysts’ average estimate of $16.5 billion, according to IBES data from Refinitiv.

Shares of Facebook, which also owns WhatsApp and Instagram, rose 0.87% after hours to $206.44 after whipsawing amid the results and guidance. The shares have recouped most of the losses sparked a year ago on concerns of slowing usage and the costs of improving privacy.

For the quarter, Facebook reported 2.7 billion monthly users and 2.1 billion daily users across Facebook, Messenger, Instagram and WhatsApp, both figures about the same as last quarter.

“News regarding FTC and data privacy, along with antitrust investigations and additional headline risks [are] likely to continue to hang over the stock, but it looks like the platform still remains a very popular destination for the users,” Morningstar analyst Ali Mogharabi said in an email to Reuters.

U.S. PROBES

Facebook has faced questions for the past three years from regulators and users worldwide over how services designed to share news and events with friends and family have become platforms for spreading misinformation about politics and health. It also suffered data breaches, prompting investigations in several countries.

The FTC inquiry settled on Wednesday stemmed from allegations that Facebook allowed information belonging to 87 million users to be inappropriately shared with the now-defunct British political consulting firm Cambridge Analytica.

Facebook, which had set aside $3 billion in the first quarter for the settlement, said it took a $2 billion charge in the second quarter to account for the remainder.

The deal, which is subject to court approval, also requires Facebook to document for the FTC any privacy-related decisions about new products. It must establish a privacy committee on its board, and executives must regularly attest to the company’s proper handling of user content.

Wehner said the settlement would require “significant investment” in hiring and technology.

The newly disclosed antitrust probe, which Facebook said it learned of from the FTC last month, shows that other regulatory hurdles remain.

FILE PHOTO: Attendees walk past a Facebook logo during Facebook Inc's F8 developers conference in San Jose, California, U.S., April 30, 2019. REUTERS/Stephen Lam/File Photo

Reuters and other news agencies reported in June that the FTC was gearing up to investigate complaints about the massive market power of Facebook and Alphabet Inc’s Google.

But Facebook on Wednesday suggested it may also be in the crosshairs of the Justice Department, acknowledging in a statement the agency’s announcement a day earlier of an antitrust review of large internet companies. The Justice Department did not specify targets, and Facebook declined to elaborate.

Facebook has expanded programs and promises in response to political pressure on several issues, including policing objectionable content.

Costs jumped 66% compared to a year ago, to nearly $12.3 billion, as Facebook continues to ramp up such initiatives.

The FTC payment in part cut second-quarter profit to $2.6 billion, compared with $5.1 billion a year earlier. Excluding the settlement and a $1.1 billion one-time tax expense, earnings would have been $1.99 per share, Facebook said.

The expectations for its ad business and cost forecasts could hurt profit margins, particularly in the fourth quarter, Facebook said.