Facebook shares jumped 7% in extended trading after the world's biggest social network posted revenue growth of 11%, its slowest ever but still far above analysts' expectations of 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 as people under lockdown spent more time online and businesses rapidly pivoted to e-commerce. Monthly active users rose to 2.7 billion, ahead of estimates of 2.6 billion.

The results were a boon for Facebook a day after its CEO, Mark Zuckerberg, took sharp jabs in a U.S. congressional hearing. Zuckerberg was among four top tech CEOs who were grilled by lawmakers on alleged abuses of market power.

On a call with investors Thursday, Facebook executives sounded notes of defiance about both demands for aggressive regulation and the July advertising boycott, which sought to pressure Facebook to take more action against hate speech.

Zuckerberg said he was "troubled" by calls to "go after" targeted advertising online. "This would reduce opportunities for small businesses so much that it would probably be felt at a macroeconomic level. Is that really what policymakers want in the middle of a pandemic in recession?"

He also pushed back on the boycott's aims, saying there was a gulf between "how the vast majority of people actually experience our services and the impression you get if you're just reading much of the commentary about Facebook."

The company appeared unscathed by the campaign, which drew the support of major advertisers including Unilever, Starbucks Corp and Coca-Cola Co.

Facebook said ad sales in the first three weeks of July grew 10% year-over-year, in line with the rate for the second quarter, and projected that ad revenue growth in the third quarter would be consistent with that, likewise faster than Wall Street estimates.

About 1,100 companies joined the boycott. Although some were among Facebook's biggest individual spenders, the bulk of Facebook's ad revenue comes from small businesses.

Zuckerberg said observers "wrongly assume that our business is dependent on a few large advertisers."

"MAJOR ROLE" FOR INSTAGRAM

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.

"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 said.

The company fared better than Alphabet Inc's Google, the world's biggest seller of online ads, which beat expectations but not by a fantastic amount. Alphabet's quarterly sales fell for the first time in its 16 years as a public company.

Facebook tempered expectations for later in the year, saying privacy changes being introduced by mobile device makers like Apple could hinder the data sharing it uses to serve personalized ads.

Such "aggressive platform policies" could "cut a lifeline" for small businesses, Facebook's chief financial officer, David Wehner, cautioned.

Total costs and expenses increased 4% to $12.7 billion in the second quarter, compared with the $12.5 billion analysts had forecast. The company was still recruiting aggressively, adding 4,200 new hires in the quarter, its most on record.

Net income came in at $5.2 billion, or $1.80 per share, in the three months ended June 30. A year earlier it earned $2.6 billion, reflecting a $2 billion charge related to a privacy settlement with the Federal Trade Commission.

Analysts had expected a profit of $1.39 per share.

By Katie Paul and Subrat Patnaik