The new Opel Astra compact gave GM Europe's sales and profits a boost in the first half of 2016. Image source: General Motors.

When General Motors (GM -0.17%) presented its second-quarter results, it had several pieces of good news for shareholders. Among them: GM Europe, long a money-loser, had turned a profit for the quarter. 

It also had some less-good news, namely that effects related to Brexit could complicate its efforts in Europe for a few quarters. But the overall story was a good one. Here's how GM did it.

How GM Europe went from a loss to a profit

GM Europe has lost billions over the last 15 years or so. But recently, a determined turnaround effort has been showing signs of bearing fruit. GM has finally taken the difficult step of integrating its German subsidiary, Opel, more fully into its global product plan. The result: Better products, growing sales -- and lower costs.

That effort, plus a recovering European new-car market, has translated into much narrower losses. In the second quarter, it translated into a pre-tax profit of $137 million. That was a big improvement over the $45 million loss it posted in the same period of last year, as you can see from this slide from GM's earnings presentation.

Image source: General Motors.

"The region achieved its second straight quarter of break-even or better results," CFO Chuck Stevens said during GM's earnings call. "In fact, not only was the second quarter profitable, but the region recorded EBIT-adjusted [GM's term for operating profit minus special items] of $131 million for the first half, up over $400 million on a year-over-year basis."

He said GM has made "substantial progress" on its plan to make Europe profitable thanks to cost reductions, the recovering market, and the success of its most recent new models, the Opel Astra and Corsa. 

Specifically, as you can see from this slide comparing GM Europe's second-quarter "EBIT-adjusted" with its results from the year-ago period, those new models have been a big help.

Image source: General Motors.

GM Europe's wholesale shipments increased by 23,000 year over year. GM attributed that increase to the rising market generally, and specifically to the success of the new Astra. The new Astra also helped boost GM's pricing, as successful new models can generally be sold with fewer discounts than the outgoing models they replace. For the first half of 2016, GM Europe's sales rose 4.7%, and it has booked pre-tax profit of $131 million. 

If you look under "Other," though, you'll see that GM Europe took a hit of roughly $100 million from foreign-exchange swings in the second quarter, specifically the Brexit-related weakening of the British pound. Stevens said Brexit could cost GM even more in the second half of 2016, putting its expectation of a full-year profit in Europe in doubt.

Brexit complicates the near-term outlook 

Stevens said Brexit could cost GM Europe as much as $400 million in the second half of the year, in part because of the exchange-rate shift, and in part because of a slowdown in new-car sales in the important U.K. market (more details here).

The subcompact Opel Corsa, new for 2015, also helped boost GM Europe's pricing in the second quarter. Image source: General Motors.

GM does have some manufacturing in the U.K, and the drop in value of the pound versus the euro will make the products made at those plants more profitable if they're exported to the Continent. But Stevens noted that on balance, GM's business tends to flow the other way. "The fact is, we import a heck of a lot more units into the U.K. than we manufacture and export out, so we're long pound sterling," he said.

GM has been able to hedge the exchange-rate risk to some extent, Stevens said. And he emphasized that the $400 million estimate was a tentative, worst-case assumption. "It's early days," he said, "and very uncertain."

The upshot: GM's strong turnaround in Europe will pay off eventually

The profit in Europe shows that GM's years-in-the-making European restructuring is on track. That's very good news, and a strong sign that GM under CEO Mary Barra is continuing to execute on its plans at a high level. 

Alas, the effects of Brexit have thrown a near-term wrench into the works. That wasn't something GM could control, of course, but it seems clear that it will dent GM's full-year result in Europe regardless, and it might well postpone its long-awaited first full-year profit in a long time. That would be disappointing. But GM shareholders should note that the longer-term picture for GM in Europe appears to still be on a very positive track.