IBM reported a 13 percent fall in revenue amid a decline in corporate spending, but cost cuts and a shift to more profitable businesses helped it achieve higher-than-expected earnings, and the company raised its outlook for the full year.

International Business Machines Corp said it now expects full-year earnings of at least $9.70 per share, up from its previous outlook of $9.20, helping its shares rise 3 percent in after-hours trading on Thursday.

IBM's second-quarter revenue fell to $23.3 billion from $26.8 billion a year earlier. That was slightly lower than analysts' average forecast of $23.5 billion, according to Reuters Estimates.

But net profit for the quarter rose to $3.1 billion from $2.8 billion in the year-ago quarter.

Profit per share rose to $2.32 from $1.97, much higher than the average Wall Street forecast of $2.01 per share, according to Reuters Estimates.

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.

(Reporting by Ritsuko Ando; Editing by Richard Chang)