Recall costs overshadowed improved margins from new products like GM's pickups in the quarter. Sales of the premium GMC Sierra are up 6.3% so far this year. Source: General Motors Co.

On Thursday, General Motors (NYSE:GM) reported a second-quarter profit of $278 million, down 80% from a year ago, as recall-related costs more than offset good gains in profit margins in North America.

Excluding special items, GM earned $0.58 a share, a penny short of the consensus Wall Street estimate of $0.59 a share as reported by Bloomberg.

It was also short of the $1.3 billion in net profit reported by old rival Ford (NYSE:F)

But a closer look at the numbers shows that, behind the immense costs of GM's recall scandal, the company's turnaround continues to show progress.

A closer look under General Motors' hood
The best way to understand GM's earnings reports is to look at results from each of the company's regional business units, and then to look at the special items that cut into profits. Note that these regional results do not include the effects of taxes.

North America
GM North America made $1.4 billion in the first quarter, down from just under $2 billion in the second quarter of last year -- but that result included the impact of about $1 billion in recall-related costs, GM said. 

The recall has been an expensive boondoggle for the General, but behind those costs and the ugly headlines, GM has a nice story unfolding here: Revenues rose 9.3%, and without the recall costs, GM's operating margins in North America would have been a solid 9.2%. 

Strong sales of GM's new full-sized SUVs, like this 2015 Cadillac Escalade, helped boost margins in the second quarter. Source: General Motors Co.

The driver of those gains was a big leap in average transaction prices in the U.S., which were up an average of about $3,000 per vehicle -- thanks in no small part to GM's all-new full-size SUVs, which have been selling briskly.

South America
GM South America lost $81 million in the second quarter, a drop of $135 million from the year-ago quarter, as revenues fell 26% amid increasingly difficult challenges across the region. As we saw with Ford's results, an economic slowdown in Brazil -- the region's largest market -- along with import restrictions in Argentina, and ongoing political challenges in Venezuela have made it hard going for many automakers in the region.  

GM CFO Chuck Stevens noted that the company did see improved pricing in South America during the second quarter thanks to newer models, but a substantial drop in sales volumes was more than enough to offset the gains. Still, the company said that its "core underlying performance" in the region is "beginning to improve."

GM has lost a ton of money in Europe over the last decade, but a turnaround effort is well under way and losses have been narrowing. But GM has warned that the drop in losses would not be "linear," and the company's loss in Europe rose to $305 million in the second quarter from a $114 million loss a year ago. One-time costs associated with GM's long-planned closure of a German factory accounted for much of the increased loss, GM said.

The small Opel Mokka was Germany's best-selling SUV during the second quarter. The Mokka, a twin of the U.S.-market Buick Encore, has been a much-needed hit for GM in Europe. Source: General Motors Co.

Revenues in Europe were up about 6.5% for the quarter, and GM said that its Opel and Vauxhall brands had increased market share in 11 European markets during the quarter. Stevens reiterated that GM Europe is still on track to be profitable by "mid-decade."

International operations
GM's international operations unit includes the company's equity stakes in its massive Chinese joint ventures. The unit earned $315 million during the quarter, up from $232 million a year ago, even as revenues declined -- but equity income from those Chinese joint ventures rose substantially.

GM's sales in China have trailed those of arch-rival Volkswagen (OTC:VWAGY), but GM has continued to gain ground in the world's largest automotive marketplace. GMIO's equity income, most of which comes from China (and is net of taxes) rose to $516 million in the quarter from $417 million a year ago.  

GM Financial
GM's in-house banking unit earned $258 million in the second quarter, up from $254 million a year ago. Compared to year-ago results, subprime exposure is down to 8.1% from 8.5% (but still a bit above the industry average of 6.8%), leasing is up substantially (a good thing), and credit losses are unchanged at a respectable 1.4%.

Those special items and recall charges
GM took a one-time charge of $400 million, its estimate of the cost of the fund it is setting up to compensate victims of accidents related to defective ignition switches in certain now-recalled GM vehicles. That estimate caused some controversy, as many observers (including your humble Fool) have expected that fund's total cost to be substantially higher once all is said and done.

GM said in a statement that, "There is no cap on [the victim-compensation fund] but this charge is the company's best estimate of the amounts that may be paid to claimants. Due to the unique nature of the program, this estimate contains significant uncertainty and it is possible the total cost could increase by approximately $0.2 billion."

GM announced that it is changing the way it estimates future recall expenses. From now on, it will hold a reserve on its balance sheet for each vehicle sold that "represents management's best estimate of future recall costs in North America."

That will be helpful going forward. To bring all of the 30 million GM vehicles currently on the road into the program, the company took a one-time charge of $874 million to cover (hopefully) the costs of potential future recalls for up to the next 10 years on those 30 million vehicles.

The upshot: Another scant profit as GM's recall saga continues
GM said that the giant wave of recalls we saw in the first half of 2014 is largely over, and that the company expects recall costs going forward to run a little higher than in past years, but not a lot higher.

But the fallout from the recall mess that landed on CEO Mary Barra's desk shortly after she took the helm in January will continue for a while. The costs of the victim-compensation fund could ultimately be quite a bit more than GM currently expects, and potentially huge fines and litigation settlements could add billions more to the tally.

But meanwhile, GM is holding up. GM's all-important U.S. sales have been solid, and its new models continue to be received well. Meanwhile, the company continues to make progress in Europe, and sales in China continue to grow. 

Long story short, investors should be cautiously optimistic going forward. While it'll be a long time before we know the full costs (financial and otherwise) of the recall mess, GM's businesses remain more or less on plan -- and on an upswing around the world.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.