General Motors Canada president Travis Hester, left, and Unifor union national president Jerry Dias shake hands during a press conference, Wednesday, May 8, 2019, in Toronto, where GM announced they are investing in its Oshawa, Ontario, plant to transition the facility from manufacturing vehicles to stamping, sub-assembly and autonomous vehicle testing. (Cole Burston/The Canadian Press via AP)

General Motors will spend $170 million to transform its Oshawa Assembly Plant into a stamping and after-market parts facility, extending the life of the historic plant and preserving 300 jobs.

The investment, announced by the presidents of GM Canada and Unifor in Toronto on Wednesday morning, will also be used to convert 55-acres of the property into a test track for autonomous and advanced vehicles, an area that GM has increasingly been focusing on.

“This new business will retain 300 Oshawa jobs, with the intent to grow and generate significant additional jobs in the coming years as the business attracts new customers,” GM Canada president Travis Hester said during the news conference.

But the $170 million plan, dubbed a “Transformation Agreement”, falls short of saving the approximately 2,300 remaining unionized jobs that will be lost when vehicle assembly production ceases at the plant in December.

Jerry Dias, president of the the union Unifor, said that while he was upset about the job losses and concerned for the community of Oshawa, the new plan is “innovative” and “makes the best out of a bad situation.”

“We knew right from the beginning that this wasn’t going to be easy, that we were going to be in an uphill battle,” Dias said.

“The fact that we are going to maintain the integrity of manufacturing for the long-term is critically important ... What GM is doing here today is they are making a long-term commitment to Oshawa.”

GM Canada’s announcement today is good news for our auto workers in Oshawa. I’d like to congratulate & thank @JerryPDias for his tireless efforts to protect these jobs. There’s more work to do to support our workers, and we will never stop fighting for them & their families. — Justin Trudeau (@JustinTrudeau) May 8, 2019

Our government welcomes the agreement between @GMcanada & @UniforTheUnion to maintain 300 good jobs at General Motors Oshawa. https://t.co/KsPH5W9Pqk — Doug Ford (@fordnation) May 8, 2019

GM had announced in November that it would halt production at its Oshawa, Ont. plant and four other North American factories, cutting thousands of jobs as part of a global restructuring plan and an increased focus on electric vehicles.

The Oshawa Assembly plant produces the Chevrolet Impala and Cadillac XTS, and its second line was recently repurposed as part of a $500 million investment to begin finishing production of GM’s popular GMC Sierra and Chevrolet Silverado trucks.

The $170 million investment – all of which will come from GM – will be used to support a transition from vehicle assembly production to stamping, sub-assembly and other miscellaneous activities for GM and its customers. Vehicle assembly production will still end at the plant in December.

Since the decision to halt production was announced, Unifor had embarked on an aggressive public relations campaign aimed at reversing GM’s decision. The campaign featured anti-GM ads that aired during the Super Bowl, Grammy Awards, Academy Awards and various NHL games. It also included a boycott urging Canadians to avoid purchasing Mexican-made GM vehicles.

The campaign was suspended in March while the union and GM held discussions.

For months, Dias had also been pushing for GM to allocate a different vehicle – ideally, a popular truck or a sports utility vehicle – to the Oshawa facility. On Wednesday, he said he “had to be realistic” and recognize that the company was not going to do that.

“These are the realities. They don’t have a vehicle for Oshawa. So the question became, ‘What the hell do we do?’” Dias said in an interview.

Dias hopes that keeping the Oshawa plant open, albeit with fewer jobs and a new purpose, will help attract new investment opportunities and jobs going forward.

“We’re going to make sure we maintain the complete integrity of the manufacturing plant, which is huge,” he said.

“In the interim, we put into place an after-market centre for GM vehicles, which is also huge when you think about the incredibly potential and possibilities.”

By leaving the plant open, GM is also leaving the door open for future opportunities, said Flavio Volpe, president of the Automotive Parts Manufacturers Association.

“The best news would have been a reversal of the November decision,” Volpe said.

“The second best news is what we have here today, which is that the company remains committed to the area, and there is a future potential for a rethink.”

GM also said it would offer special relocations for Oshawa employees at some of its other Ontario production locations, as well as offering “enhanced retirement packages” for eligible employees. The automaker will also open a “Jobs Action Centre” in June, aimed at helping employees find employment opportunities.

Download the Yahoo Finance app, available for Apple and Android.