General Motors announced Monday that it planned to idle five factories in North America and cut roughly 14,000 jobs in a bid to trim costs. It was a jarring reflection of the auto industry’s adjustment to changing consumer tastes and sluggish sales.

The move, which follows job reductions by Ford Motor Company, further pares the work force in a sector that President Trump had promised to bolster. Referring to G.M.’s chief executive, Mary T. Barra, he told reporters, “I spoke to her and I stressed the fact that I am not happy with what she did.”

Mr. Trump also invoked the rescue of G.M. after its bankruptcy filing almost a decade ago. “You know, the United States saved General Motors,” he told reporters, “and for her to take that company out of Ohio is not good. I think she’s going to put something back in soon.”

In addition to an assembly plant in Lordstown, Ohio, the cuts affect factories in Michigan, Maryland and the Canadian province of Ontario.

Part of the retrenchment is a response to a slowdown in new-car sales that has prompted automakers to slim their operations and shed jobs. And earlier bets on smaller cars have had to be unwound as consumers have gravitated toward pickup trucks and sport-utility vehicles as a result of low gasoline prices.

In addition, automakers have paid a price for the trade battle that Mr. Trump set in motion. In June G.M. slashed its profit outlook for the year because tariffs were driving up production costs, raising prices even on domestic steel. Rising interest rates are also generating headwinds.

Ms. Barra said no single factor had prompted G.M.’s cutbacks, portraying them as a prudent trimming of sails. “We are taking these actions now while the company and the economy are strong to stay in front of a fast-changing market,” she said on a conference call with analysts.

Image

Workers leaving the General Motors factory in Lordstown, Ohio, on Monday. “For her to take that company out of Ohio is not good,” President Trump said of G.M.’s chief executive, Mary T. Barra.CreditAlan Freed/Reuters

The idling of the five plants next year will result in the layoff of 3,300 production workers in the United States and about 2,500 in Canada. The company also aims to trim its salaried staff by 8,000. The cuts represent more than 10 percent of G.M.’s North American work force of 124,000.

Investors welcomed the news, sending G.M.’s shares up 4.8 percent to their highest closing price in about three months.

Word of the cutbacks in Canada had surfaced over the weekend. Just before G.M.’s announcement, workers walked out of the plant in Oshawa, Ontario, into a driving rain. Waving red flags and clad in ponchos bearing the logo of their union, Unifor, they began blockading truck entrances.

Prime Minister Justin Trudeau said he had expressed his “deep disappointment” about the closing to Ms. Barra.

The United Auto Workers, representing workers at the American plants, said G.M.’s move “will not go unchallenged.” Closing domestic plants while expanding production in China and Mexico is “profoundly damaging to our American work force,” said the union vice president in charge of negotiations with G.M., Terry Dittes.

The plants include three car factories: one in Lordstown that makes the Chevrolet Cruze compact; the Detroit-Hamtramck plant, where the Chevrolet Volt, Buick LaCrosse and Cadillac CT6 are produced; and the plant in Oshawa, which primarily makes the Chevrolet Impala. In addition, the company will halt operations at transmission plants in the Baltimore area and in Warren, Mich.

G.M., Ford and Fiat Chrysler are all poised to negotiate new labor contracts next year. Some of the affected G.M. plants could resume production, depending on the outcome of the bargaining. Carmakers often agree to keep plants open in exchange for other concessions from the union.

Image

General Motors employees hugging while staging a blockade and protest at one of the entrances to the company’s plant in Oshawa, Ontario. G.M. said the plant would halt production next year.CreditIan Willms for The New York Times

Earlier this year, Ford said it would stop making sedans for the North American market and announced cuts in its work force. Fiat Chrysler stopped making small and midsize cars in 2016.

Closing auto plants outright — rather than idling them, as G.M. says it plans — has been rare since the industry emerged from the recession. The last permanent shutdown of a plant in the United States came in 2016 when Mitsubishi Motors shuttered one in Normal, Ill. Before that, Ford closed a truck plant in St. Paul in 2011.

More typically since rebounding from the recession, carmakers and their suppliers have restarted shuttered plants, adding new ones across the South and hiring tens of thousands of workers a year.

But demand for small and midsize cars has plunged. Two-thirds of all new vehicles sold last year were trucks and S.U.V.s. That shift has hit G.M.’s Lordstown plant hard. Just a few years ago, the factory employed three shifts of workers to churn out Chevy Cruzes. Now it is down to one. In 2017 the plant made about 180,000 cars, down from 248,000 in 2013.

More broadly, the yearslong boom in car and truck sales in North America appears to be ending, said John Hoffecker, vice chairman at AlixPartners, a global consulting firm with a large automotive practice. “Sales have held up well this year, but we do see a downturn coming,” he said. AlixPartners forecast that domestic auto sales will fall to about 15 million cars and light trucks in 2020, from about 17 million this year.

Even though they are facing a potential slump, carmakers continue to spend heavily to develop electric vehicles and self-driving technology, both to meet regulatory mandates and to anticipate the future of driving. That shift is expected to remake the global industry and enable companies to enter new and potentially lucrative businesses, such as driverless taxi and delivery services.

At the same time, automakers have had to contend with a new political agenda in Washington. One benefit has been the corporate tax cuts enacted last year. The changes, championed by Mr. Trump and his party, saved G.M. $157 million in federal taxes in the first nine months of the year, according to the company’s most recent quarterly earnings report.

Video

President Trump expressed unhappiness with General Motors’ announcement that it planned to idle five North American factories and cut more than 14,000 jobs.Published OnNov. 26, 2018CreditCreditAl Drago for The New York Times

The Trump administration has moved to scrap stringent emissions requirements put into place under President Barack Obama, but the industry hopes that Mr. Trump will relent and reach an agreement with California, which sets its own emissions requirements. Automakers are wary of having two sets of standards.

Before the election and after, Mr. Trump prodded Ford, G.M. and others to build plants in the United States instead of Mexico or China. As events have played out, however, his determination to rework the North American Free Trade Agreement is expected to have a modest impact on automakers, preserving much of the original 1994 accord.

The terms negotiated with Canada and Mexico stipulate that at least 75 percent of an automobile’s value must be produced in North America for a company to import it into the United States duty-free, and that 40 to 45 percent of a vehicle’s value must consist of parts made by workers earning at least $16 an hour, a provision aimed at shrinking Mexico’s wage advantage. Analysts believe the changes will have little to no effect on American jobs.

Over all, the American auto industry has added nearly 350,000 jobs since the industry bottomed out in the wake of the recession. But the industry still employs tens of thousands fewer people than before the crisis, and hundreds of thousands fewer than in 2000.

About 970,000 people worked in the United States auto industry in October, an increase of 12,800 since Mr. Trump took office. Most of that growth, however, came among manufacturers of recreational vehicles and trailers, as well as in auto parts. Through October, automakers like G.M. had cut about 7,000 jobs under Mr. Trump, government figures show. (Those numbers don’t include the hundreds of thousands of workers employed by auto dealers, repair shops and related industries.)

Ms. Barra said G.M. would set aside up to $2 billion in cash to pay for the job reductions announced Monday, and take noncash charges against its pretax earnings of about $1.8 billion. The charges will affect earnings in the fourth quarter of 2018 and the first quarter of 2019.

Until last month, G.M. had been offering severance packages to entice salaried employees in North America to leave the company. In January, the company plans to cut additional white-collar jobs on an involuntary basis. Between the two actions, it aims to eliminate about 15 percent of its salaried jobs in North America.

General Motors also said on Monday that it would stop production at two unspecified plants outside North America by the end of next year.

Ian Austen and Ben Casselman contributed reporting.

A version of this article appears in print on , on Page A1 of the New York edition with the headline: G.M. to Eliminate Some 14,000 Jobs At Five Factories. Order Reprints | Today’s Paper | Subscribe