This wasn't supposed to happen. Given the weakness in the advertising market, Alphabet (GOOGL 0.35%) wasn't supposed to have a strong first quarter. But it did. And now, after many investors had lost interest in the tech giant because it looked to be trailing in the artificial intelligence (AI) race, some may be reconsidering.

After its strong Q1 report, I think Alphabet is an absolute buy at these prices -- particularly because one of its most exciting segments just became profitable.

Google Cloud finally turned the profitability corner

While most of the buzz around Alphabet these days has to do with AI, at its core Alphabet is still an advertising company. In Q1, advertising revenue made up 78% of its total, with Google Search playing a significant role in that figure. Given an uncertain economic outlook, many companies have tightened their ad budgets as marketing is one of the easiest expenses for an organization to control.

While advertising revenue fell by 0.4% in Q1, Google Search revenue actually rose by 2%, reflecting that its clients still see it as a must-advertise location. While that's not market-crushing growth, it speaks to Alphabet's resilience at a time when many are saying it's over for Google.

The real winner in the quarter was Google Cloud, where revenue rose by 28% to $7.5 billion. While that's an impressive growth rate, what really drew investors' interest was its new-found profitability; Google Cloud booked a $191 million profit in Q1, its first profit ever. This was up from a $706 million loss in Q1 2022 -- amounting to a $897 million increase in operating income.

Costs continue to rise despite layoffs

However, Alphabet did display one red flag in its latest quarter: rising operating costs. If you've followed Alphabet over the past year, you're likely aware that its expenses have been growing, and that pattern continued in Q1.

Although news of Alphabet's layoffs made headlines over the past six months, the company actually had about 500 more employees at the end of Q1 than it did at the end of Q4. This didn't help its operating expenses, which rose across the board in Q1.

Line Item Increase in Expenses (YOY)
Research and Development 26%
Sales and Marketing 12%
General and Administrative 12%

Data source: Alphabet.  YOY = year over year.

As a result, Alphabet's operating margin fell from 30% in the prior-year period to 25% in Q1 2023, dragging its earnings per share (EPS) from $1.23 down to $1.17.

But these expenses have risen for a reason: Alphabet sees a massive opportunity in AI. From generative AI in its cloud to helping users get more useful results to their search queries, Alphabet plans to be an AI-first company. Google Cloud will also benefit from this trend as customers looking to run AI models will need massive computing capacity.

Because Google Cloud is the only cloud provider with servers built around Nvidia's new L4 Tensor Core GPU, it's the go-to choice for any client looking to maximize its AI potential. Although its rising expenses will cause the company pain in the short term, they can be expected to provide a long-term net positive.

The stock is cheap compared to historical levels

The stock now trades at around 22 times free cash flow, near its lowest valuation in nearly a decade by that metric.

GOOGL Price to Free Cash Flow Chart

GOOGL Price to Free Cash Flow data by YCharts.

While Wall Street analysts only expect revenue to rise by 4.7% this year, they anticipate growth of 11.4% next year. With long-term opportunities in cloud computing and AI, plus the reliability of Alphabet's advertising revenue, the stock looks like a no-brainer buy at these prices. And as the stock barely moved in the wake of its better-than-feared quarterly report, investors can still take advantage of this opportunity.