MENLO PARK (AP) — Facebook doubled its profit in the second quarter thanks to a massive increase in advertising revenue, especially the average price of ads it delivers to its nearly 3 billion users.

But the company said it doesn’t expect revenue to continue to grow at such a breakneck pace in the second half of the year.

READ MORE: Fmr. Pinole Police Officer Allegedly Videotaped Himself Having Sex With Minor

The Menlo Park, California-based company earned $10.39 billion, or $3.61 per share, in the April-June period. That’s up from $5.18 billion, or $1.80 per share, a year earlier. Revenue jumped 56% to $28.58 billion from $18.32 billion. Analysts, on average, were expecting earnings of $3.04 per share and revenue of $24.85 billion, according to a poll by FactSet.

Advertising revenue growth was driven by a 47% year-over-year increase in the average price per ad and a 6% increase in the number of ads shown to people. Facebook said it expects ad prices, not the amount of ads it delivers, to continue to drive growth.

READ MORE: UPDATE: Woman Accused of Starting Fawn Fire Was Boiling Bear Urine to Drink

The company said, as it has before, that it expects challenges in its ability to target ads this year — including regulatory pressure and Apple’s privacy changes that make it harder for companies like Facebook to track people who can opt out of that form of surveillance.

Facebook had 2.9 billion monthly users as of June, up 7% from a year earlier. Shares fell $11.77, or 3.2%, to $373.28 in after-hours trading. Earlier in the day, the stock hit an all-time high of $377. 55 in anticipation of the results, so the decline wasn’t unexpected.

MORE NEWS: SF Police Arrest 2 Men Who Allegedly Shot Woman Who Refused To Give Them Her Camera

© Copyright 2021 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.