(Reuters) - International Business Machines Corp's <IBM.N> revenue rose for the first time in 23 quarters and beat analysts' estimates as the company's shift into its focus areas such as cloud computing and security services gains traction.

IBM's shares tumbled about 4 percent in extended trading on Thursday. In October, the company had flagged a possible return to growth and since then its stock has gained about 16 percent, including rallying about 10 percent since the start of 2018.

"IBM hit their numbers, so I think the reason why shares are down is the shares have been up materially in the last 18 days ... so they're giving a little bit of that up," Pivotal Research analyst Lou Miscioscia said.

IBM's quarterly profit, excluding a charge related to the recent U.S. tax overhaul, just edged past analysts' estimates and the company did not detail the expected impact of the new tax rates on current year's results.

"It's really the uncertainty of how 2018 shapes out. The big portion of that is tax," said CFRA analyst David Holt.

"Yes it's going to be headwind but we really don't know when and how they will be able to recognize those discrete items, and the second one would be the actual growth margin pull."

To counter a slowdown in its legacy hardware and software businesses, IBM has in recent years targeted high-margin "strategic imperatives" such as cloud computing, cybersecurity, mobile and data analytics that flow across its five business units.

That has helped its revenue decline slow down in recent quarters and finally turn a corner last quarter. Wall Street expects IBM's revenue to grow in the current quarter and the next quarter as well, according to Thomson Reuters I/B/E/S.

"Well I think the expectations got ahead of themselves ... they (IBM) have not given 2018 guidance yet, they're going to give that in the call, so were still waiting for more information," Miscioscia said.

IBM's "Strategic imperatives" includes the contribution of cloud computing – where firms use a remote network of data centers instead of their own hardware to cut costs.

IBM swung to a loss of $1.05 billion from a year-ago profit of $4.50 billion, due to a $5.5 billion tax reform-related charge. Its adjusted profit of $5.18 per share was a penny above analysts estimates.

(This version of the story corrects the brokerage name in paragraph 5 to CFRA from MacMillan Communications)

(Reporting by Pushkala Aripaka in Bengaluru; Editing by Maju Samuel and Savio D'Souza)