Facebook's stock jumped Wednesday after the social media giant reported stronger-than-expected results for the first quarter thanks to soaring ad revenue.

The company said it earned $9.5 billion, or $3.30 per share, in the January-March period. That's up 94% from $4.9 billion, or $1.71 per share, a year earlier.

Revenue grew 48% to $26.17 billion from $17.44 billion.

Analysts, on average, were expecting earnings of $2.35 per share and revenue of $23.73 billion, according to a poll by FactSet.

The average price of ads on Facebook grew 30% from a year earlier, while the number of ads increased by 12%.

Facebook had 2.85 billion monthly users, on average, in March. That's up 10% from a year earlier. Its family of apps - Facebook, Instagram and WhatsApp - had monthly users of 3.45 billion in March. That's the number of people who logged in to at least one of the apps during the month.

In January, the company predicted uncertainty for 2021, saying its revenue in the latter half of the year could face significant pressure. Because revenue grew so quickly in the second half of 2020, Facebook could have trouble keeping up that pace. This uncertainty is now baked into the company's forecast, so it didn't come as a surprise to investors.

Shares of the Menlo Park, California-based company rose nearly 6% in after-hours trading.

On Monday, Apple rolled out a new privacy feature, dubbed “App Tracking Transparency,” as part of an update to the operating system powering the iPhone and iPad. It came after a seven-month delay during which the iPhone maker and Facebook attacked each other's business models and motives for decisions that affect billions of people around the world.

Until the new feature, Facebook and other apps have been able to automatically conduct their surveillance on iPhones unless users took the time and trouble to go into their settings to prevent it - something not many people did.

While Facebook spent months fighting the change, CEO Mark Zuckerberg recently suggested that the new privacy controls could actually help his company in the long run. His rationale: The inability to automatically track iPhone users may prod more companies to sell their products directly on Facebook and Instagram if they can't collect enough personal information to effectively target ads within their own apps. This would help Facebook's bottom line, of course.

Facebook said Wednesday it expects its second-quarter 2021 revenue growth to stay stable or “modestly accelerate” compared with the growth rate in the first quarter. The Apple update is already factored into this guidance.