What happened

Shares of General Motors (NYSE:GM) surged on Wednesday after GM reported third-quarter earnings that were much stronger than analysts had expected and hinted that its full-year profit could exceed its guidance.

GM's shares ended the trading day at $36.58, up 9% from Tuesday's closing price. 

So what

GM's third-quarter net income of $2.5 billion was a huge improvement over the loss it posted a year ago, when it took hefty accounting charges after the sale of a subsidiary. It was also quite a surprise: On an "adjusted" basis, excluding one-time items, GM earned $1.87 per share -- trouncing Wall Street's $1.26 average estimate.

A 2019 GMC Sierra Denali, a full-size luxury pickup truck.

GM began shipping the all-new 2019 GMC Sierra Denali in August. Fully loaded, the new luxury pickup's price is around $70,000, making it a very profitable product for GM. Sales have been brisk, helping GM to surprisingly good third-quarter margins. Image source: General Motors.

What happened? GM's sales in the U.S. and China were down versus the third quarter of 2017, and analysts had expected its adjusted earnings before interest and tax ("EBIT-adjusted," in GM-speak) to fall as well. But GM was able to boost its profit margins by selling a more profitable mix of trucks and SUVs, reducing its incentives (in the U.S.), and selling more high-profit Cadillacs (in China). 

In the U.S., GM's EBIT-adjusted margin rose to 10.2% from 8.3% a year ago, driving a 37% increase in EBIT-adjusted in GM's North America region. In China, its margin rose to 8.7% from 7.9% a year ago, driving a 5.7% increase in equity income from GM's Chinese joint ventures (to $485 million) despite a 14.9% drop in overall sales. 

The results: an earnings surprise, a strong hint from CFO Dhivya Suryadevara that GM's full-year adjusted EPS could exceed its guidance -- and a big jump in GM's share price on Wednesday. 

Now what

GM's full-year profit will almost certainly still be lower than its 2017 result, even if it exceeds guidance. But GM's third-quarter result shows that it's holding up better than many rivals as sales slow and commodity prices rise. 

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.