Analysts who follow IBM expected the company to turn in a gain of $2.02 a share on sales of $23.59 billion, according to a consensus from Thomson Reuters.
Mike Holland, chairman of investment firm Holland & Co, had been expecting strong numbers but said he was stunned by how positive they turned out.
"Big Blue blockbuster," he said. "The full-year guidance for $9.70 was incredible. I have never seen anything like that in the years I have been following IBM. In an unpleasant economic and financial world, these are incredible results."
IBM shares , which closed Thursday up 3.19 percent at $110.64, were up almost another 2 percent in extended trading. Get live after-hour quotes for IBM here.
IBM has fared better than many other technology companies amid the recent economic downturn, helped by its growing focus on profitable software and services like outsourcing and technology support rather than increasingly commoditized hardware.
Its gross profit margin rose to 45.5 percent from 43.2 percent a year earlier, it said.
Chief Executive Samuel Palmisano said the results underscored how the company's transformation was working.
"We are well ahead of pace for our 2010 roadmap of $10 to $11 per share," he said in a statement.
The upbeat results added to the market's optimism following leading chipmaker Intel's stronger-than-expected earnings and outlook announcement this week.
Intel had said that while it was feeling the effects of a recession and slowdown in IT spending, the industry was returning to seasonal business patterns.
"This, combined with Intel's results, is pushing me to be more optimistic," said Kim Caughey, senior analyst at Fort Pitt Capital Group.
"Seeing they made it on the bottom line, and were pretty darned close on the top line, it gives me confidence looking at technology in general," she said.