Facebook beat analysts' estimates for quarterly revenue, as businesses used its digital advertising tools to tap a surge in online traffic during the coronavirus pandemic even as they slashed marketing budgets elsewhere.
Shares of the world's biggest social network jumped 7% in extended trading on Wall Street.
Facebook's revenue growth was its slowest ever as a public company, reported at 11%, although it beat analysts' expectations that it would sink to 3%, according to IBES data from Refinitiv.
Ad sales, which contribute nearly all of Facebook's revenue, rose 10% to $18.3 billion in the second quarter. Monthly active users rose to 2.7 billion, ahead of estimates of 2.6 billion.
Facebook projected that ad revenue for the third quarter is likewise expected to grow faster than Wall Street estimates, despite an unprecedented ad boycott in July that drew the support of companies including Unilever, Starbucks and Coca-Cola.
Only about 1,100 companies joined the boycott to pressure the social network to take more action against hate speech, out of millions of Facebook advertisers.
Although some were among the company's biggest individual spenders, the bulk of Facebook's ad revenue comes from small businesses.
The company said its ad sales in the first three weeks of July grew 10% year-over-year, in line with the rate for the second quarter, it said. It forecast ad revenue growth in the third quarter would be consistent with that July performance.
Investors were bracing for difficulties in the second quarter, which was the first to reflect the full impact of virus-related lockdowns.
Facebook said in April it was seeing signs of stability for sales in the first three weeks of the quarter after a plunge in March.
Debra Aho Williamson, principal analyst at eMarketer, said she believed Facebook unit Instagram played a "major role" in helping the company withstand the effects of the pandemic.
"Facebook has successfully attracted digital-native businesses to its platform, especially those that market products or services that can be used or consumed by people staying at home," she said.
"Although Facebook doesn't release details about Instagram's revenue, we believe that Instagram has been a rapidly growing contributor to the company's total revenue, and that its success is helping to buoy Facebook as a whole," she added.
Revenue growth at Facebook, the world's second-biggest seller of online ads after Alphabet's Google, had been cooling even prior to the pandemic as its business matured, although it still came in at more than 20% throughout 2019.
Facebook's chief executive Mark Zuckerberg said in April that the company would somewhat control costs this year in response to the pandemic, without "slamming on the brakes" on strategic investments.
Total costs and expenses increased 4% to $12.7 billion in the second quarter, compared with the $12.5 billion analysts had forecast.
Net income came in at $5.2 billion, or $1.80 per share, in the three months ended June 30. It had been $2.6 billion a year earlier, reflecting a $2 billion charge related to Facebook's privacy settlement with the Federal Trade Commission.
Analysts had expected a profit of $1.39 per share.