In 2024, artificial intelligence (AI) continues to play a role in a stock's success after rising to prominence last year. Plenty of tech companies have trumpeted the use of AI, but many didn't even exist when International Business Machines (IBM -1.05%) started working on the technology back in the 1950s.

IBM's deep expertise in this area allowed the company's AI book of business to double between the third and fourth quarters of last year. This rapid AI growth is one of the reasons why IBM shares jumped to a 52-week high of $197 in January, its highest share price in a decade.

The stock price has pulled back from this high, which may make you wonder whether IBM is a buy now. A closer look into Big Blue can help determine if the company makes a good long-term investment.

AI's role in IBM's revenue growth

Despite its long history with AI, IBM didn't make this technology a central focus of the company until Arvind Krishna became CEO in 2020. Thanks in part to this prioritization of AI, IBM delivered strong financial performance in 2023.

Big Blue ended the fourth quarter with revenue up 4% over 2022, reaching $17.4 billion, as all segments of its business experienced year-over-year sales gains. This propelled IBM to $61.9 billion in full-year revenue.

The company's 2023 results were the latest in a trend of steadily rising revenue over the past couple of years.

IBM Revenue (Annual) Chart

Data by YCharts.

AI was one of the contributing factors to IBM's sales growth. Krishna noted, "Every client I speak with is asking about how to boost productivity with AI."

This is where IBM's consulting division comes into play. Big Blue's consultants help businesses create an AI strategy and implement the technical components. This consultative capability is a competitive advantage.

Krishna stated, "We are the only provider today that offers both a technology stack... and consulting services for deploying and managing generative AI."

As a result, Q4 revenue in IBM's consulting segment was up 6% over 2022, comprising $5 billion of Big Blue's $17.4 billion in sales for the quarter.

IBM's success beyond AI

AI isn't IBM's only area of success. Its Red Hat cloud computing division enjoyed strong 8% year-over-year revenue growth in Q4, and annual bookings increased 17%. This rise in annual bookings indicates customers plan to spend more on Red Hat's cloud computing services, suggesting IBM's Q4 sales success is likely to continue in 2024.

Even IBM's infrastructure division, which sells hardware such as computer servers, saw year-over-year sales rise 2.7% in Q4 to $4.6 billion. This business segment is sensitive to product cycle swings, and its latest mainframe server, the z16, has been out for seven quarters.

If z16 sales were on the wane, it would be understandable. Instead, the z16 outperformed prior models thanks to innovations such as embedded AI capabilities, as well as cybersecurity capable of protecting from hacks generated by quantum computers. Quantum computing represents the next generation of computing machines, and IBM is developing this technology as well.

Helped by its revenue growth, Big Blue saw 2023 free cash flow (FCF) make a substantial jump to $11.2 billion from $9.3 billion in 2022. FCF indicates the cash profits a company has available for activities such as investing in its business and funding its dividend.

So IBM's FCF growth is a positive sign for investors, solidifying the company's ability to continue offering its attractive dividend, currently yielding over 3%.

Big Blue paid out $6 billion in dividends last year, so its 2023 FCF total comfortably covered this expense, allowing the company to increase its dividend for the 28th straight year. IBM expects to deliver a greater amount of FCF, about $12 billion, in 2024.

To buy or not to buy IBM stock?

IBM has a lot going for it right now. It's doing well across all its business segments. Its revenue growth in 2024 looks encouraging given Q4's double-digit increase in annual bookings. FCF generation remains strong, enabling Big Blue the flexibility to raise its dividend.

Moreover, the company benefits from the secular trend of AI. The AI market is expected to reach $305.9 billion this year, up from $241.8 billion in 2023, and is forecasted to grow to $738.8 billion by 2030. This serves as a multiyear tailwind for Big Blue.

All of these factors combine to make IBM stock an attractive long-term investment. With the share price not far from its 52-week high, a prudent approach is to use dollar-cost averaging to build your position. And you'll receive dividend payments as passive income while you continue to build your position over the long term.