By Sarah E. Needleman

Facebook Inc. posted a sharp increase in quarterly revenue and profit as it benefited from a wave of digital ad spending but said it expects growth to slow later this year from factors including Apple Inc.'s new ad-targeting rules.

The social-media giant said Wednesday its first-quarter earnings report reflects the past year's trend of people spending more time and money online and advertisers redirecting their resources to take advantage of that shift. The parent of Facebook, Instagram and WhatsApp said the average price per ad and the number of ads it delivered during the January-through-March period increased.

Revenue rose 46% from a year earlier to $25.44 billion, while profit nearly doubled to $9.5 billion, or $3.30 a share. Analysts polled by FactSet were expecting revenue of $23.73 billion and for profit to grow 39% to $6.8 billion, or $2.35 a share.

Facebook's shares rose more than 4% in after-hours trading. The stock has gained 16% over the past three months through Wednesday's close, compared with a more than 10% gain in the S&P 500.

Apple and Facebook have butted heads in recent years over issues such as user privacy and app-store fees, and now they are at odds over the iPhone maker's move this week to begin enabling its mobile customers to opt out of letting third-party apps collect certain data. Facebook Chief Executive Mark Zuckerberg has criticized the move, saying it will hurt small businesses. Apple has said it wants app makers to first obtain users' permission to enable such tracking.

In its earnings report, Facebook also said that the strong revenue growth experienced late last year might be tough to repeat. The global advertising business slowed dramatically in the early days of the pandemic, but Facebook as well as other digital platforms rebounded quickly and posted strong revenue and profits in the second half of 2020. As a result of tough financial comparisons and Apple's new rules, the social-networking company said it expects year-over-year revenue growth to slow in the third and fourth quarters.

Facebook Wednesday also pledged to accelerate spending on investments including technical and product talent and consumer hardware. The company has said it is working to enable users to listen to podcasts through Facebook and create Clubhouse-like rooms for live audio conversations. It last month said it is working on augmented-reality glasses in tandem with sensor-packed wristbands that can detect finger movements.

"What that says is they're aggressive in their pursuit of growth," said Truist Securities analyst Youssef Squali. "They're doubling down on investments."

Write to Sarah E. Needleman at sarah.needleman@wsj.com

(END) Dow Jones Newswires

04-28-21 1706ET