Big Blue earned $2 billion, or $1.15 a share, on sales of $21.6 billion.
First Call consensus pegged the computing-services giant for a profit of $1.15 a share on sales of $22.6 billion. Unlike many technology companies, IBM did not issue a profit warning.
The $21.6 billion in sales marks a slight decline from the year-ago quarter, when it pocketed $1.9 billion, or $1.06 a share, on sales of $21.65 billion.
IBM shares closed off $4.25 to $104.28 ahead of the earnings report before falling to $101.60 in after-hours trading.
"We're pleased with our second-quarter results," Chief Financial Officer John Joyce said during a conference call with analysts. "We've been winning a growing share of our customers' spending."
Last quarter, IBM met analysts' estimates when it posted a profit of $1.75 billion, or 98 cents a share, on sales of $21 billion.
In May, Chief Executive Lou Gerstner outlined the company's long-term strategy to use its massive services business as the linchpin for growth.
IBM followed through on this commitment in the second quarter as its global services sales increased 7 percent to $8.7 billion in the quarter, becoming the company's largest individual business unit. IBM said it signed $16 billion in services contracts and finished the quarter with a services contract backlog of about $95 billion.
Hardware sales fell 5 percent, to $8.7 billion, even though mainframe computer and data-storage products posted strong growth in the quarter.
Its software sales fell 5 percent, to $3 billion in the quarter, while global financing sales increased 3 percent to $845 million.
Looking ahead, Joyce said the U.S. dollar's strength in Europe and Japan could crimp earnings by as much as 14 cents a share.
"We were able to absorb the currency and equity (charges) this quarter because of the growth in our services business," Joyce said. "If our major microelectronics customers don't start growing their business in the third quarter, our third-quarter growth could fall by approximately five points, a point more than what the April rates would have suggested."
IBM's microelectronics sales grew 12 percent in the second quarter, down from an improvement of 49 percent in the first quarter.
"IBM usually hits the consensus estimate, but in this environment everything is off the table," said Shebly Seyrafi, an analyst at A.G. Edwards. "The idea that they can continue to defy the economic conditions is hard to believe."
Ahead of the earnings results, Seyrafi pegged IBM for a profit of $1.15 a share on sales of around $21 billion.
"They continue to outperform everyone else in the technology industry," he said. "Even if they were to miss estimates by a penny or two a share, that would have been great compared to the other companies, who are missing by a couple cents a share on estimates of 10 cents or 20 cents a share."
Gross profit margins improved to 37.3 percent this quarter compared with 36.3 percent in the year-ago quarter, highlighting the company's ability to grow the bottom line despite the drastic price cuts made by competitors.
By region, sales to North and South America slid 1 percent to $9.6 billion in the quarter. Sales to Europe, the Middle East and Africa dropped 1 percent to $5.8 billion, while Asia-Pacific sales slipped 2 percent to $4.3 billion.
"The thing that separates IBM from the rest of the technology companies that have missed estimates in the past several quarters is that when its sales decline, it's almost exclusively a cyclical issue," said Dan Kunstler, an analyst at J.P. Morgan H&Q. IBM's issues are cyclical and related to macroeconomics, while other companies are struggling with these same issues along with their own internal problems, he said.
Kunstler, who pegged IBM for a profit of $1.10 a share this quarter, agreed with many pundits who expected IBM to miss the consensus estimate because of its significant exposure in Europe as well as the profit warnings and murky outlooks provided by its competitors.
"What Gerstner has been saying is that IBM is sitting on some very strong legs, especially its services business," he said. "Not only is IBM seeing strong growth from its services business, but that business has become an excellent delivery vehicle for its new technology."
While most other technology stocks continue drift lower, IBM shares have managed to hold up relatively well considering the macroeconomic conditions.
Its shares peaked at a 52-week high of $134.94 in September before falling to a low of $80.06 in December.
Twelve of the 16 analysts following the stock maintain either a "buy" or "strong buy" recommendation.