DETROIT (Reuters) - General Motors Co GM.N posted stronger-than-expected pre-tax profit for the third quarter on Tuesday, helped by cost-cutting and a shift to higher-margin trucks and sport utility vehicles, and its shares jumped to a record high.

GM reported a net loss due to charges related to the sale of its European operations, but the automaker’s operating results beat Wall Street expectations and the company reaffirmed a forecast that 2017 financial results would be in line with last year’s record performance.

The automaker also assured investors it was on track to cut stocks of unsold vehicles in the U.S. to a manageable 70-days’ supply by the end of the year.

GM, rival Fiat Chrysler Automobiles NV FCHA.MI, and heavy machinery maker Caterpillar Inc CAT.N all are benefiting from a strong U.S. economy, continued growth in China and a recovery in demand from Latin America.

In the case of the automakers, U.S. car and light truck sales have so far defied predictions of a significant slump. September sales hit the fastest pace in 12 years as residents of Texas and Florida rushed to replace cars damaged by storms.

The latest results sent GM shares up 2.3 percent to the highest levels since its initial public offering in 2010, amid a broad rally by U.S. manufacturing stocks.

GM over the past several months has regained its status as the largest U.S. automaker by market capitalization over electric luxury car maker Tesla Inc TSLA.O.

Some of GM’s share price surge has come from investors betting on its investments in self-driving and electric cars. The company’s profits, however, are driven entirely by demand for its petrol-fueled trucks and SUVs in North America, and its growing sales in China.

The No. 1 U.S. automaker said it expects U.S. vehicle sales to remain stable at an annual pace of about 17 million light vehicles in 2017, “and we expect that in 2018 as well,” GM Chief Financial Officer Chuck Stevens told reporters on Tuesday.

FILE PHOTO - The GM logo is seen at the General Motors Warren Transmission Operations Plant in Warren, Michigan October 26, 2015. REUTERS/Rebecca Cook/File Photo

The U.S. auto industry has been coming off a strong run of sales that culminated in a record 17.55 million units in 2016. Industry analysts have predicted a slight decline for U.S. new car sales in 2017, driven in part by a flood of nearly-new, low-mileage off-lease vehicles into the market.

GM’s share price has risen nearly 30 percent this year, in part as the company has highlighted efforts to put self-driving cars on the road. However, spending on autonomous vehicles and ride services amounted to just $150 million in the latest quarter, the company indicated in its financial report.

GM posted lower revenue for the quarter as it shuttered plants in North America to reduce production and tackle bloated inventory levels, especially of unpopular sedan models as consumers move increasingly to pickup trucks, SUVs and crossovers.

GM had 76 days’ supply of unsold vehicles at the end of September, down from 88 days a month earlier and over 100 in the summer. The company’s wholesale volumes were down 26 percent versus the same quarter in 2016.

GM is taming its inventory problem in the United States in part by laying off about 3,100 temporary and full-time hourly workers, mainly at factories that build compact and midsize sedans. The rapid shift by U.S. consumers to SUVs and pickup trucks in response to low, stable gasoline prices has left GM with too many North American factories tooled to produce low-profit sedans, analysts said.

GM showed a pre-tax profit in North America despite the steep production cuts and heavy discounts. Stevens credited cost-cutting and a shift to higher-profit trucks and sport utility vehicles. The company cut North American production costs by $2 billion during the first nine months of 2017.

GM posted a quarterly net loss on Tuesday due to charges stemming from the sale of its Opel unit in Europe to France's Peugeot SA PEUP.PA.

Detroit-based GM posted a third-quarter net loss of $2.98 billion, or $2.03 per share, compared with a profit of $2.77 billion, or $1.71 per share a year earlier. Excluding discontinued operations, GM posted a net profit of 8 cents per share.

But excluding one-time charges, the company earned $1.32 a share, above analyst expectations of $1.14.

Revenue in the quarter fell to $33.6 billion from $38.9 billion a year earlier. Analysts had expected revenue of $32.72 billion.