Fiat Chrysler Automobiles fcau reached a tentative deal with unionized workers in Canada by agreeing to make more than C$400 million ($301 million) in investments in local operations, the union said late on Monday.

The deal was announced just minutes ahead of a midnight strike deadline that could have sent more than 9,000 workers off the job.

“This has been one very difficult set of negotiations,” said Jerry Dias, national president of the union, Unifor.

Union members will vote on the deal at ratification meetings on October 16. A strike is still possible if workers vote against the deal.

A strike by Canadian workers would have disrupted production of minivans built in Windsor, Ontario, including the new Chrysler Pacifica, as well as sedans assembled in Brampton, Ontario northwest of Toronto.

As part of the deal, Fiat Chrysler has agreed to invest C$325 million in a new paint shop at the Brampton facility, the union said. The company will provide additional funding taking its investment under the agreement to more than C$400 million, Dias said.

The company confirmed it reached a tentative agreement with Unifor, but said because it is subject to member ratification it could not discuss the specifics.

Unifor represents Canadian manufacturing workers at Fiat Chrysler, Ford Motor f and General Motors gm . It uses a pattern bargaining strategy to negotiate with the three automakers, selecting one company to hold talks with and then holding the other two to the broad terms of that deal.

For more on Fiat Chrysler, watch Fortune’s video:

It reached a pattern deal with GM last month, including new investment that is expected to save thousands of jobs at the company’s Oshawa, Ontario plant.

Dias said the union will move on to the Ford negotiations in one week if ratification takes place as planned. The strike deadline for Ford is the end of month.

Unifor had said ahead of contract talks that its top priority would be securing new investment in Canada, including an overhaul of the Brampton paint shop.

The Brampton plant builds large sedans, including the Chrysler 300, Dodge Challenger and Dodge Charger, employing about 3,300 unionized workers.

With some 6,000 unionized workers, the Windsor van plant produces all of Fiat Chrysler’s minivans for the North American market, including the new Chrysler Pacifica, the Chrysler Town and Country and the Dodge Caravan.

The contract also covers about 450 workers that make parts in Toronto’s west end.