IBM's shares, which have rallied 10 percent so far this year on hopes of a strong turnaround in the company's fortunes, fell more than 3 percent in extended trading on Thursday.

The company forecast stable margins and revenue for 2018, buoyed by growth in its newer businesses such as cloud computing and security services.

However, IBM forecast an operating profit of at least $13.80 per share for 2018, compared with $13.80 in 2017 and market expectations of $13.92, according to Thomson Reuters I/B/E/S.

"According to Street expectations, we're already very low for earnings, ... but still, you would have liked to have seen, with the little better revenue trajectory and some positive comments, that would have played in to a nicer number," Pivotal Research analyst Lou Miscioscia said.

IBM forecast a 2018 operating tax rate of 16 percent, plus or minus 2 percentage points, compared with a rate of 12 percent in 2017.

"Tax will be a headwind in 2018," IBM veteran and new Chief Financial Officer James Kavanaugh said on a conference call.

Kavanaugh said IBM would continue to "maintain a high level of investment" in 2018 as it boosts its capabilities on its high-margin "strategic imperatives" such as cloud, mobile, cybersecurity and data analytics.

That focus, started by Chief Executive Ginni Rometty, has helped IBM counter its faltering legacy hardware and software businesses and slow its revenue declines in recent quarters.

The company's revenue finally rose in the latest fourth quarter, the first year-over-year increase since the first quarter of 2012, just after Rometty became CEO.

Revenue from IBM's cloud business jumped 30 percent in the latest quarter. Revenue from all "strategic imperatives" rose 17 percent.

Total revenue increased 3.6 percent to $22.54 billion, beating analysts' average estimate of $22.06 billion.

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 beat estimates by a penny.

The company's adjusted gross margins of 49.5 percent fell short of market expectations of 50.8 percent.

IBM shares were down 3.4 percent at $163.40 in extended trading.

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

By Pushkala Aripaka and Sonam Rai