Image copyright Reuters Image caption General Motors will halt production at five plants in North America, including the Oshawa plant in Canada

General Motors (GM) plans to halt production at five factories in North America and cut more than 14,000 jobs.

The US carmaker has also announced it will close three plants outside North America by the end of 2019.

The moves follow rising costs and slower car sales and come as the firm focuses on its line-up of trucks, electric and self-driving vehicles.

But the restructuring drew swift criticism from politicians, including President Donald Trump.

"I am not happy about it," he said of the plans, which undercut his claims that his policies are spurring a revival in the US auto industry.

"They better put something else in."

Why is the company doing this?

Image copyright AFP/Getty Image caption US buyers have turned away from smaller cars in favour of SUVs and trucks

The production cuts come as buyers in North America have turned away from smaller cars to bigger vehicles such as SUVs and trucks, which now make up nearly 70% of total US car purchases.

Ms Barra said GM wants to invest in electric and autonomous vehicles, which are expected to drive future industry growth.

She is also responding to rising costs - including from new tariffs on materials such as steel - while preparing the firm for the next downturn, after US car sales peaked in 2016.

The company said the plan would help it save about $6bn (£4.7bn) by the end of 2020.

"The actions we are taking today continue our transformation to be highly agile, resilient and profitable, while giving us the flexibility to invest in the future," said GM chair and chief executive Mary Barra.

"We recognise the need to stay in front of changing market conditions and customer preferences to position our company for long-term success."

What are the details?

GM said it is cutting production of the Buick LaCross, Chevrolet Impala and Cruze, as well as the Cadillac CT6 and XTS - all sedans - as well as the Chevrolet Volt and older versions of the Silverado and Sierra.

The closures in North America include an assembly plant in Oshawa, Canada; facilities in Detroit and Warren in Michigan; a plant in Warren, Ohio and a site near Baltimore in Maryland.

It is also closing a factory in South Korea, as announced in February, as well as two other international facilities that were not specified.

Image copyright AFP/Getty Image caption Labour leaders in the US and Canada said they would fight the cuts

GM said it expects the cuts in North America to affect more than 6,100 shift workers at the five plants, as well as more than 8,000 salaried employees.

Globally, the firm, which employed about 180,000 salaried and shift staff at the end of last year, is aiming to reduce the number of salaried employees by 15%, including 25% fewer executives.

The firm had signalled some of its plans previously, offering voluntary buyouts to up to 18,000 workers in October.

Analysis by Michelle Fleury

GM boss Marry Barra said the firm was embarking on the cuts to "keep ahead of changing market conditions".

Some of those changing conditions have little to do with the White House.

But others do.

Take the tariffs on steel - a key component in the production of cars. They have pushed up GM's costs by an estimated $1bn.

Then there are shifting trade agreements and the president's proposal to raise tariffs on imported cars.

New tax cuts passed last year were designed to encourage companies like GM to invest at home, but today's announcement signals the lower tax rates are not enough to offset rising expenses.

So while investors may cheer today's moves as a boost to GM's bottom line, they're a blow to President Trump and his many boasts about bringing car industry jobs back.

What is the response?

Shares in the company jumped almost 5% after the announcement, but the firm faced attacks outside of Wall Street.

Canadian Prime Minister Justin Trudeau said he called Ms Barra to express his "deep disappointment" in the closure of the Canadian GM plant, which has been in the province of Ontario for a century.

US Senator Sherrod Brown, a Democrat who represents Ohio, called the decision "corporate greed at its worst", while Republican Senator Rob Portman, also of Ohio, said he was "deeply frustrated".

Mr Trump, whose threats have frequently singled out the car industry, said he thought the pressure on GM would lead it to direct new work to the plants, at least in Ohio.

"I was very tough when I spoke to [Ms Barra]," he said. "They say the Chevy Cruze is not selling well. I said well get a car that is selling well and put it back in."

Labour unions in the US and Canada also said they would press the company to allocate more work to the factories, instead of closing them.

"To be clear, [we do] not accept the closure of the plant as a foregone conclusion," labour leaders at the Oshawa factory in Canada wrote to their members.

"Remember, our plant has been in this situation before with no product on the horizon and we were able to successfully campaign for continued operations."