Investors sent GM shares up more than 6 percent in morning trading.
The loss of $5.62 per share in the April-June period compared with a loss of $987 million, or $1.75 per share, for the same period last year.
But without the one-time charges, GM said it earned $1.2 billion, or $2.03 per share. That was significantly ahead of the 55 cents per share forecast by analysts polled by Thomson Financial.
Revenue climbed to $54.4 billion, compared with $48.5 billion in the second quarter of 2005.
"We're particularly pleased with the speed with which our people have implemented our turnaround plan. Conventional wisdom is that you can't turn a ship as big as GM around quickly. We aim to prove that conventional wisdom wrong," GM Chairman and Chief Executive Rick Wagoner said in a statement.
Wagoner said the company had increased its target for reducing annual costs in North America to $9 billion from $8 billion by the end of 2006.
"Our turnaround has not just gained traction, it's accelerating into high gear," he said. "While significant work still remains, our ability to identify and initiate $9 billion in cost cuts over the course of the past year is unprecedented in this industry."
The second-quarter loss included a total of $4.3 billion in special charges, including a $3.7 billion after-tax charge related to buyouts and early retirements, which allowed GM to reduce its hourly work force by 34,400. One-time items also included a loss related to the pending sale of a 51 percent stake in finance arm GMAC, a gain on the disposition of Isuzu stock and other restructuring charges.
In North America, excluding special items, GM lost $85 million, a $1.1 billion improvement over the second quarter of 2005.
Wagoner acknowledged in his statement that beyond cutting costs, GM must do better at selling vehicles in North America. He said the company's newer products, including full-size SUVs, the Chevrolet Impala and HHR, and the Pontiac G6, were doing well.
"We know we have to develop and build great cars and trucks to grow our business and we're encouraged by the recent success of our newest vehicles, particularly in the U.S. market," Wagoner said. "Our newly launched vehicles will account for about 30 percent of our U.S. retail sales this year and grow to 40 percent next year."
Chief Financial Officer Frederick "Fritz" Henderson characterized the quarter as one of "good, solid progress," driven largely by cost savings, though GM is expecting most of its cost reductions to take effect in the second half of the year.
He told reporters at GM's Detroit headquarters that the company needs to "keep making progress on the revenue side to get the business turned around."
Henderson said that per-vehicle revenue increased in North America even though volume was flat. That increase was driven by a greater share of high-margin sport-utility vehicles in the product mix, he said.
"The Yukon, Yukon Denali, Escalade, Tahoe, Suburban, Avalanche — we love them," Henderson said. "So do customers. That's even more important."
GM, which lost $10.6 billion last year, launched a major restructuring in November that called for closing 12 plants by 2008, slashing its workforce and cutting structural costs by $4 billion this year.
GM is currently in talks with Nissan Motor Co. of Japan and Renault SA of France about the possibility of joining their global alliance. Wagoner has said that while he believes it makes sense to examine whether there are potential benefits from a linkup, he does not want to get distracted from the turnaround plan.
The proposal to join the alliance came from billionaire investor Kirk Kerkorian, who holds a 9.9 percent stake in GM. It has fueled speculation that Kerkorian is dissatisfied with the pace of the turnaround under Wagoner and wants to carve out a role for Nissan and Renault CEO Carlos Ghosn, a legendary turnaround specialist in the industry. Analysts had said strong second-quarter results would bolster Wagoner's position.
Henderson said he said the quarter's success would have no impact on the talks.