General Motors (GM -0.91%) reported a 2017 pre-tax profit that matched its record result in 2016 and set another all-time record for earnings per share, on strong sales of high-profit trucks and SUVs.

But huge one-time charges related to the new U.S. tax law and GM's sale of Opel AG erased nearly all of that profit on a GAAP net income basis, though most of the charges were non-cash accounting adjustments.

Excluding those one-time items, GM earned $6.62 per share in 2017, a record. For the fourth quarter of 2017, GM earned $1.65 per share on the same basis, trouncing Wall Street's consensus $1.38 estimate.

A red 2018 Chevrolet Equinox, a midsize crossover SUV.

An all-new version of the huge-selling Chevrolet Equinox crossover SUV helped boost GM's profit and margins in 2017. Image source: General Motors.

The raw numbers

Metric Q4 2017 Change vs. Q4 2016 Full Year 2017 Change vs. 2016
Revenue $37.7 billion (5.5%) $145.6 billion  (2.4%)
Vehicles sold 2,593,879 (8.9%) 9,600,340 (4.1%)
EBIT-adjusted $3.1 billion 18.7% $12.8 billion no change
EBIT-adjusted margin 8.2% 1.7 percentage points 8.8% 0.2 percentage points
Net income (loss) ($4.87 billion) ($6.9 billion) $348 million ($9.1 billion)
Adjusted earnings per share $1.65 21.3% $6.62 8.2%
Automotive operating cash flow $6.6 billion  40.4% $13.9 billion (4.1%) 

Data source: General Motors. All financial numbers are reported on a "continuing operations" basis, excluding results for GM's former subsidiary Opel AG. "EBIT-adjusted" is GM's non-GAAP expression of EBIT (earnings before interest and taxes) minus one-time items.

Should we worry about those huge one-time charges?

GM has for several years carried what it calls "deferred tax assets" on its balance sheet. These are tax deductions that GM is entitled to take because of its huge losses during the last recession. Because the U.S. corporate tax rate has been cut from 35% to 21%, those deferred tax assets have lost $7.3 billion in value, and GM took that $7.3 billion as a one-time charge against its fourth-quarter earnings.

Earlier in the year, GM took a total of $6.2 billion in charges related to the sale of its German subsidiary, Opel AG, to French automaker Peugeot SA.

To sum up: One-time items decreased GM's net income by $7.3 billion in the fourth quarter and by $13.5 billion for the full year. But the key takeaway for investors is that most of that was a paper accounting adjustment. The actual impact on GM's cash was modest, and not a concern in light of GM's strong underlying earnings.

How GM managed huge pre-tax profits in a declining market

GM's global sales fell 8.9% in the fourth quarter, and its revenue was down 5.5% from a year ago. But GM's fourth-quarter EBIT-adjusted actually rose almost 19%, to $3.1 billion from $2.6 billion in the fourth quarter of 2016. How did the automaker pull that off?

A bar chart comparing GM's Q4 2016 EBIT-adjusted to its 2017 result. It shows that while lower wholesale shipments hurt by $1.1 billion, GM was able to more than offset that with roughly $1.6 billion in cost cuts and profitablity gains.

Image source: General Motors.

Simply put, GM offset the profit decline you'd expect with lower sales by improving profitability and cutting costs. That profitability improvement was driven by great sales of GM's trucks and SUVs, particularly its new line of car-based "crossover" SUVs.

GM replaced nearly all of its crossover SUVs with all-new models in 2016 and 2017. The new models are more profitable than the vehicles they replaced, and as a group, they are huge sellers. That accounts for much of the improvement shown under "price" in the chart above. The improvement in "mix" is related: GM sold a larger proportion of (higher-profit) SUVs and trucks relative to (lower-profit) sedans in 2017 than in 2016.

And the cost improvements? Some of that, roughly $500 million, was due to what GM calls "warranty cost" improvements: Less money spent on recalls versus the year-ago period, and some changes that GM made to the reserves maintained for warranty claims as it has evaluated the (improved) reliability of its newer models over time. The remainder was a series of more-traditional cost cuts, offset to some extent by higher prices for commodities like aluminum and steel.

How each of GM's business units performed

Note: Results here are presented on a pre-tax basis.

GM North America: The unit earned $2.9 billion in the fourth quarter. That was up from $2.7 billion a year ago despite a 13% drop in wholesale shipments, on the profitability improvements outlined above. Its EBIT-adjusted margin, a widely watched figure, was a very strong 10%.

For comparison, rival Ford Motor Company (F -3.01%) posted an operating margin of 6.8% in North America in the fourth quarter, while Fiat Chrysler Automobiles'(FCAU) North America adjusted-EBIT margin was 7.9%. GM's profitability in North America outpaced both of its traditional Detroit rivals' in both the fourth quarter and the full year.

For the full year, GM North America earned $11.9 billion, with a margin of 10.7%, a record.

GM International: The new catch-all business unit for GM's rest-of-world automotive operating results earned $416 million in the fourth quarter, up from $223 million a year ago. Simply put, the story here was continued strong performance in China and roughly $200 million in improvements in South America. Equity income from GM's China joint ventures totaled $504 million, versus $525 million in the fourth quarter of 2016.

For the full year, GM International earned $1.3 billion, up from $767 million a year ago.

GM Financial: The company's captive financing unit earned $301 million in the fourth quarter, up from $163 million a year ago. The unit saw good growth in 2017, largely in the U.S., while its credit-quality metrics remained stable.

For the full year, GM Financial earned $1.2 billion, up from $763 million a year ago.

Cash and debt

As of the end of 2017, GM had $19.6 billion in cash, down from $21.6 billion a yer ago. (That was a planned decline: GM reduced its cash-reserve target in the wake of the Opel sale.) It had another $14.1 billion in available credit lines, for total liquidity of $33.6 billion.

Against that, GM had $13.5 billion in well-structured long-term debt, up from $10.6 billion a year ago.

The upshot: A strong quarter and a strong year

The GAAP net income number might look scary, but here's the real takeaway: All things considered, GM had a great fourth quarter and a great 2017.

While CEO Mary Barra (as always) sees room for improvement, GM's strong margins in a weakening market show that the improvements implemented over the last few years are already bearing fruit, and GM is well-positioned for another strong year in 2018.