Facebook’s profit more than doubled in the most recent quarter as digital advertising surged, but the company warned of slower growth in the months ahead in an update that sent its stock plummeting.

According to Facebook’s second quarter report, profit increased to $10.4 billion on revenue of $29 billion, a 56 percent increase from the previous year, owing primarily to an increase in ad revenues.

The number of people using the social network on a monthly basis increased by 7% year on year to 2.9 billion. In addition, approximately 3.5 billion people used at least one of the company’s apps, which included Instagram, WhatsApp, and Messenger. “We had a strong quarter as we continue to help businesses grow and people stay connected,” Facebook CEO Mark Zuckerberg said in a statement.

However, Facebook shares fell 4% after the tech giant warned that growth would slow due to regulatory actions and a change to the Apple iPhone operating software that could harm its ad targeting.

“We continue to expect increased ad targeting headwinds in 2021 as a result of regulatory and platform changes, particularly the recent iOS updates,” Facebook said in its earnings release. Apple’s move earlier this year sparked a schism with Facebook and other tech rivals, and it could have far-reaching consequences for data privacy and the mobile ecosystem.

Apple began requiring apps to inform users of its mobile devices about the tracking information they wish to collect and to obtain permission to do so.

Opting out of tracking makes it more difficult for companies like Facebook to target the ads on which they rely for revenue.

“This has been very difficult for advertisers, and we’re working with them to help them navigate these changes,” said Facebook chief financial officer David Wehner during an earnings call. The findings come as Facebook and other large tech firms face increased scrutiny from antitrust regulators in the United States and elsewhere for their market dominance.

Although a case brought against Facebook in a US federal court last year was dismissed, authorities are seeking to refile the case, which could lead to the social media giant’s demise.

According to industry tracker eMarketer, Facebook is on track to generate more than $100 billion in annual ad revenue for the first time.

According to eMarketer, Google is the leading digital ad publisher, accounting for nearly 29 percent of the market, with Facebook accounting for just under 24 percent. “This quarter’s Facebook results are extremely strong and show little sign of impact from Apple’s iOS update as of yet,” said Debra Aho Williamson, an analyst at eMarketer.

She went on to say that the current quarter “will be a much more important quarter to pay attention to, as the full effects of the Apple update take hold.”

Increasing prices drove ad revenue growth, with “enormous” demand for Facebook and Instagram ad space driving competition, according to the analyst.

On an earnings call, Zuckerberg stated that the social network is focusing on increasing e-commerce and ways for creators to make money from online content, while also investing in the creation of an immersive digital world known as the “metaverse.” The term “metaverse,” coined by sci-fi author Neal Stephenson, refers to a shared online world in which multiple users can hang out, spend money, consume media, and potentially even work.

Facebook recently brought together experts from its hardware, gaming, and virtual reality divisions to work on the metaverse.

“Think of it as an embodied internet that you’re inside of rather than just looking at,” Zuckerberg said during the earnings call.

“You’ll be able to do everything you can do on the internet today, as well as some things that don’t make sense on the internet today, like dancing.”