The turnaround story for International Business Machines (NYSE:IBM) hinges on the company's growth businesses becoming big enough to push both revenue and profits higher. The market has been hesitant to buy into this narrative -- shares of the century-old tech giant trade close to their 52-week low.

That skepticism will be a little harder to maintain after IBM's second-quarter report. The company beat analyst estimates across the board, grew revenue adjusted for currency, and produced double-digit pre-tax income growth. IBM's strategic imperative growth businesses accelerated compared to the first quarter, and the cloud business continued to boom.

The IBM Cloud logo.

The IBM Cloud logo. Image source: IBM.

Growing revenue

IBM's second-quarter revenue jumped 4% year over year to $20 billion, beating the average analyst estimate by $120 million. Backing out the impact of currency, revenue still grew by 2%. That's a lot better than the flat currency-adjusted revenue IBM reported for the first quarter.

IBM's strategic imperatives revenue rose 15% on a reported basis, and it grew 13% adjusted for currency. That's better than the 10% adjusted growth rate in the first quarter. Analytics revenue jumped 5% to $5.4 billion, while cloud revenue rose 18% to $4.7 billion. Trailing-12-month cloud revenue has now reached $18.5 billion, with the as-a-service portion currently at an $11.1 billion revenue run rate.

The hardware business also helped revenue. Sales of IBM's mainframe systems more than doubled compared to the same period last year, and both the Power and storage businesses produced growth as well. IBM's latest mainframe system began shipping in the third quarter of last year, so the company is still enjoying a spike in sales triggered by upgrading customers.

Security was a standout during the second quarter, with IBM reporting $1.0 billion of revenue, up 79% year-over-year. Strong sales of the mainframe, which features advanced encryption capabilities, contributed to that growth.

Margins on the rise

While IBM's adjusted gross margin declined by 0.6 percentage points compared to the second quarter of last year, the company's pre-tax margin moved in the opposite direction. IBM converted 16.9% of revenue into pre-tax profit, a 1.1-percentage-point increase year over year.

This margin expansion was driven by operational efficiencies in the cognitive solutions segment, revenue mix and productivity gains in the global business services segment, and strong sales of mainframe systems.

IBM's adjusted earnings per share came in at $3.08, up 5% year over year and $0.04 ahead of analyst expectations. Revenue and pre-tax margin growth drove the increase, partially offset by a tax headwind related to a discrete tax benefit in the second-quarter of last year. Share buybacks also helped the cause.

"More clients are engaging IBM on their journey to the cloud, and deploying IBM Cloud, Watson AI, analytics, blockchain and security solutions. This demonstrates IBM's unique leadership in providing innovative technology coupled with deep industry expertise, trust and security," said IBM CEO Ginni Rometty in the earnings press release.

The pieces are falling into place

Strategic imperatives now account for 48% of IBM's total revenue over the past twelve months. Cloud computing accounts for around 23% of revenue. Both are still growing by double-digit percentages, more than offsetting declines in other parts of the business.

While gross margin slumped in the second quarter, pre-tax margin is on the rise. IBM maintained its full-year earnings and free cash flow guidance, despite the strong quarter. The company expects adjusted earnings per share of at least $13.80, along with free cash flow of roughly $12 billion.

IBM will lap the mainframe launch in the third quarter, creating a revenue headwind that the company will need to overcome. This will also hurt strategic imperative and cloud revenue, since mainframe sales play a role in both of those categories. I suspect this is one reason why IBM is keeping its guidance unchanged.

This is the best quarter IBM has produced in a long time. Almost every number moved in the right direction. There may be some turbulence in the second half as mainframe sales decline, but IBM's turnaround is finally starting to show the kind of results that investors have been waiting for.

Timothy Green owns shares of IBM. The Motley Fool has no position in any of the stocks mentioned. The Motley Fool has a disclosure policy.