Facebook has warned of a tougher 2021 despite beating analysts' estimates for quarterly revenue as businesses adjusting to the global coronavirus pandemic continued to rely on the company's digital ad tools. 

The world's biggest social media company said in its outlook that it faced "a significant amount of uncertainty."

It cited impending privacy changes by Apple and a possible reversal in the pandemic-prompted shift to online commerce. 

"Considering that online commerce is our largest ad vertical, a change in this trend could serve as a headwind to our 2021 ad revenue growth," it said.

Shares of the social media giant were flat in extended trading on Wall Street last night. 

Facebook's financial results and those of Google and Amazon demonstrate how resilient tech giants have been even as the pandemic devastated other parts of the economy. 

The success has earned them extra scrutiny in Washington, where the companies face multiple competition investigations. 

Facebook's total revenue, which primarily consists of ad sales, rose 22% to $21.47 billion from $17.65 billion in the third quarter ended September 30, beating analysts' estimates of a 12% rise, according to IBES data from Refinitiv. 

A July ad boycott over Facebook's handling of hate speech, which saw some of its biggest individual spenders press pause, barely made a dent in its sales, which mostly come from small businesses. 

Revenue growth at Facebook, the world's second-biggest seller of online ads after Google, has been cooling steadily as its business matures, although it came in at more than 20% during 2019. 

But compared to expectations, the company has had a bumper year due to surging use of its platforms by users stuck at home amid virus-related lockdowns.

This cushioned online ad sales even as broader economic activity suffered.

Facebook continued to expand its user base, with monthly active users rising to 2.74 billion, compared with estimates of 2.70 billion according to the IBES data, although user numbers declined in North America compared to the second quarter. 

The company projected that trend would continue for the rest of the year, with user numbers either flat or slightly down in the fourth quarter compared to the third quarter. 

Total expenses increased 28% to $13.43 billion, with costs continuing to grow as Facebook tries to build out its non-ad businesses and quell criticism that its handling of user privacy and abusive content is lax. 

Facebook CFO Dave Wehner said on an earnings conference call that expenses would rise due to the costs of returning work-from-home staff to offices as well as increased headcount, product investments and higher legal expenses. 

He said the company was expecting a margin decline as a result, although he did not give specific revenue guidance. 

The company has been under especially strong pressure ahead of next week's US presidential election and is aiming to avoid a repeat of 2016, when Russia used its platforms to spread election-related misinformation. 

Facebook said its net income came in at $7.85 billion, or $2.71 per share, compared with $6.09 billion, or $2.12 per share, a year earlier. 

Analysts had expected a profit of $1.90 per share, according to IBES data from Refinitiv.