Meta, the parent company of Facebook, WhatsApp, and Instagram, reported strong first-quarter earnings on Wednesday, but a disappointing second-quarter forecast and increased spending plans for artificial intelligence (AI) sent shares tumbling by more than 15% in after-hours trading.

The social media giant's revenue rose 27% to $36.46 billion in the first quarter, surpassing analysts' expectations of $36.16 billion. However, Meta's guidance for the second quarter, which projects revenue between $36.5 billion and $39 billion, fell short of the midpoint estimate of $38.24 billion.

In addition to the downbeat Q2 forecast, Meta CFO Susan Li raised the company's full-year total expenses estimate from a range of $94 billion-$99 billion to $96 billion-$99 billion, citing higher infrastructure and legal costs. The company also expects its Reality Labs division, which focuses on AI, AR, and VR efforts, to report increased year-over-year operating losses.

During the earnings call, CEO Mark Zuckerberg acknowledged that while Meta is scaling capex and energy expenses for AI, it will continue to focus on operating the rest of the company efficiently. "But realistically, even with shifting many of our existing resources to focus on AI, we'll still grow our investment envelope meaningfully before we make much revenue from some of these new products," he added.

Meta's stock had been on a tear prior to the earnings report, climbing 131% over the last 12 months and more than 39% year-to-date, outperforming chief rival Google. The company's strong performance can be attributed to a recovery in the digital advertising market and its announcement of a $0.50 per share dividend and a $50 billion increase in its stock buyback authorization last quarter.

Despite the sharp drop in share price following the earnings report, some analysts see logic in Meta's approach. Sophie Lund-Yates, from Hargreaves Lansdown, noted that Meta's substantial investment in AI has helped the company keep users engaged on its platforms, leading advertisers to spend more money even amid digital advertising uncertainty.

Meta has made several announcements regarding its AI efforts in recent months, including the debut of its Meta AI chatbot and Llama 3 large language model on April 18. The company also stands to benefit significantly if Congress's TikTok ban, which President Biden signed into law on Wednesday, survives legal challenges, as users and creators may turn to rival platforms like Instagram.

However, regulatory risks remain a concern for Meta. Last year, the company was fined €1.2bn (£1bn) by Ireland's data authorities for mishandling people's data when transferring it between Europe and the US. In February of this year, CEO Mark Zuckerberg faced blistering criticism from US lawmakers and was pushed to apologize to families of victims of child sexual exploitation.