Meta Platforms (META 2.98%) has been betting big on artificial intelligence (AI), and those investments paid off in the second quarter as the company crushed earnings and revenue expectations. That sent the stock soaring, with it now up 28% on the year, as of this writing.

Let's take a closer look at the social media company's Q2 results and future prospects to see if the stock's momentum can continue or if it's too late to jump on board.

AI powers strong results

Meta is using AI in two key ways to help drive growth. First, it's making its content recommendations better, which keeps users on its apps longer. More time on the platform means more ads served. Second, it's using AI to improve ad targeting through its generative ads recommendation system. That's leading to better ad results and higher prices. Both are helping power Meta's ad business, as seen in its Q2 results.

Its Q2 revenue soared 22% year over year to $47.52 billion, while earnings per share (EPS) jumped 38% year over year to $7.14. For the second time this year, the results blew past consensus estimates. Analysts were only looking for revenue of $44.8 billion and EPS of $5.92, as compiled by LSEG.

Advertising revenue climbed 22%, coming in at $46.6 billion. Revenue at Reality Labs, which is home to Meta's metaverse efforts and its augmented reality headsets and smart glasses, rose 5% to $370 million. Operating income from its social media apps jumped 29% to $25 billion, while Reality Labs recorded a loss of $4.5 billion.

Meta's advertising growth was led by an 11% jump in ad impressions and a 9% increase in average price per ad. These metrics show how Meta's AI efforts have been helping the company both increase user engagement and improve ad conversion.

The company has also started to roll out ads to both its new social media app Threads and its popular global messaging platform WhatsApp. However, neither is expected to be a big contributor this year. It said the ads on WhatsApp will be introduced gradually with initial low levels of ad supply and that they will earn a lower average price than Facebook or Instagram ads, since the app is used more by people in emerging markets.

Meta also continues to nicely grow its number of users. Family daily active people (DAP), a measurement of registered users who log in to one of Meta's apps daily, increased by 6% year over year to 3.48 billion. That was also above analyst expectations for DAP of 3.45 billion.

Looking ahead, Meta forecasts Q3 revenue to be between $47.5 billion to $50.5 billion, for growth of 17% to 24% year over year. That was well ahead of the $46.1 billion revenue consensus. The company did note that it expects its Q4 growth to be slower than Q3, given tougher comparisons.

The company also increased the low end of its full-year capital expenditures to a range of $66 billion to $72 billion, up from a prior forecast of $64 billion to $72 billion. It said it expects to spend a similar amount in 2026 to help meet the demands of its AI efforts.

On the call, CEO Mark Zuckerberg discussed how the company's AI investments are aimed at achieving "super intelligence," which he said is when AI "surpasses human intelligence in every way." He added that improvement is slow but in sight. He also believes the technology should be used more for creative purposes and "individual empowerment," not for automation and efficiency.

Artist rendering of AI in brain.

Image source: Getty Images.

Is Meta stock still a buy?

Meta is currently firing on all cylinders. AI is driving strong revenue growth, increasing user engagement, and improving ad conversion. Meanwhile, the company is slow-walking serving ads on Threads and WhatsApp, which should help drive growth in later years. Meta is even nicely adding more users -- not bad for a company whose platforms were considered dying just a couple of years ago by investors.

The company's strong performance is letting Zuckerberg invest aggressively in both AI infrastructure and talent. If he can pull off his AI-metaverse vision, the stock could just be getting started.

Looking at valuation, Meta stock trades at a forward price-to-earnings (P/E) ratio of around 30 times 2025 analyst estimates and 27 times the 2026 estimates. The stock is not the bargain it was in the past, but its revenue growth has meaningfully ticked up, and it's investing heavily to be an AI leader.

While I wouldn't buy the stock hand over fist at these levels, I think it still remains an attractive long-term buy.