By Jeff Horwitz

Facebook Inc.'s third-quarter revenue climbed 22% to $21.47 billion, as strong digital ad spending offset a high-profile ad boycott, restrictions that reduce the efficacy of ad targeting and continued fallout from the pandemic.

Facebook reported per share earnings of $2.71 in the three months through September, compared with $2.12 in the year-earlier quarter, beating analysts' average projection of $1.90, according to data from FactSet. Facebook's net income rose to $7.85 billion from $6.09 billion.

The company also announced its expectations for a strong fourth quarter. But tempering those results, Facebook Chief Financial Officer David Wehner warned of a "significant amount of uncertainty" in the coming year. While the company believes the pandemic has accelerated the shift to online commerce, he said, it faces significant regulatory threats in both the U.S. and abroad as well as limitations imposed on its data gathering and targeting by other tech giants, including Apple Inc.

The company's operating margin stood at 37%, compared with 41% a year earlier, as headcount rose by a third over the past year. The number of people using Facebook products each month -- which include Instagram, Messenger and WhatsApp -- increased to 3.21 billion from 2.82 billion a year ago, up 14%.

Following the third-quarter report, Facebook's stock rose about 5% in after-hours trading. As of Thursday's close, Facebook shares had risen by more than 33% since the beginning of the year, with pandemic-driven surges in user growth and increased use of its platforms compensating for both the advertiser boycott and lower spending by Covid-stricken advertisers in retail, travel and entertainment. U.S. political advertising also provided a boost, with some analysts predicting the spending boom could account for a mid single-digit percentage of Facebook's total revenue.

The third quarter began on a difficult note for Facebook, with a boycott over its alleged failure to rein in hate speech on the platform. Civil rights groups including the National Association for the Advancement of Colored People and the Anti-Defamation League convinced major advertisers including Verizon and Unilever to temporarily stop spending on Facebook's platforms, a halt that the company acknowledged would likely weigh on its results.

Facebook also has warned that it expected slower revenue growth due restrictions from both data protection laws in California and limitations on data sharing by other tech companies.

Write to Jeff Horwitz at Jeff.Horwitz@wsj.com

(END) Dow Jones Newswires

10-29-20 1652ET