After three consecutive quarters of revenue growth, International Business Machines (NYSE:IBM) was unable to keep the ball rolling in the third quarter. Revenue declined by 2% year over year to $18.8 billion, missing the average analyst estimate by more than $300 million.

That headline revenue decline was enough to send the stock tumbling Wednesday morning. But there was plenty to like about IBM's report.

IBM's corporate headquarters in Armonk, NY.

IBM's corporate headquarters in Armonk, NY. Image source: IBM.

Currency, mainframes, and the cloud

The majority of IBM's revenue comes from outside the U.S., so a strengthening U.S. dollar tends to knock down the company's growth rate. That's exactly what happened in the third quarter. While reported revenue slumped 2%, revenue adjusted for currency was flat compared to the third quarter of 2017. Currency effects made IBM's report look worse than it really was.

One big surprise in IBM's third-quarter report was the enduring strength of its latest z14 mainframe system. The typical mainframe cycle involves four quarters of growth followed by declines until the next hardware refresh. IBM began shipping the z14 in the third quarter of last year, so a sales decline was expected in the third quarter of this year. But IBM managed to grow its mainframe business by 6% year over year. The company hasn't produced five consecutive quarters of mainframe growth since 2007.

IBM's mainframe revenue will almost certainly decline in the fourth quarter. But with the z14 being "the most successful in our platform's long history," according to CFO James Kavanaugh during the earnings call, it's clear that the mainframe is alive and well in the age of the cloud.

Speaking of the cloud, IBM's cloud business grew by 13% adjusted for currency in the third quarter. Cloud revenue over the past 12 months has reached $19 billion, and the annual run rate for cloud delivered as a service now sits at $11.4 billion.

IBM's cloud strategy is focused on helping its customers navigate a complicated array of cloud options. The company announced its Multicloud Manager earlier this week, a tool that allows workloads to be managed across various public clouds and on-premises hardware. And it recently announced that IBM Cloud Private, its year-old private cloud platform, has been adopted by more than 400 global companies.

At its core, IBM is a company that provides integrated solutions for its customers. Its cloud strategy is in the same vein.

Margin stabilization

Gross margin has been a problem for IBM throughout its transformation over the past six years. The company managed a GAAP gross margin of 45.8% in 2017, down from 50% in 2014.

After years of heavy investments in new growth businesses, IBM's gross margin is finally showing signs of stabilization as those businesses scale. IBM's overall gross margin was flat in the third quarter on a year-over-year basis. That might not sound great, but it's the best gross margin performance in three years.

The services segments were the main drivers of IBM's gross margin stabilization. The global business services segment grew revenue by 3% and gross margin by 2.7 percentage points, while the technology services and cloud platforms segment produced flat revenue and a 1.2-percentage-point gross margin improvement. A shift toward higher-value offerings, productivity improvements, and increased scale in certain businesses were responsible for the margin improvements.

IBM's overall pretax margin rose by 0.5 percentage points on a non-GAAP basis to 19.2%. That helped boost non-GAAP earnings per share by 5% to $3.42. The company reiterated its full-year guidance, calling for at least $13.80 in per-share earnings and around $12 billion of free cash flow.

A stock's value is ultimately derived from profits, not revenue. IBM is having some trouble consistently growing the top line, but the margin improvement that investors have been waiting for seems to have finally arrived. If IBM produces earnings growth in 2019 and beyond, the beaten-down stock could be due for a recovery.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.