Canadian workers at Ford Motor f voted to approve a new four-year contract with the automaker, the Unifor union said on Sunday, wrapping up months of contract talks.

The union said in a release that 58% voted to approve the deal, but Oakville local president Dave Thomas said only 45% of members at his unit supported the agreement.

“Bargaining is always tough, but reaching this contract was no small feat,” said Chris Taylor, who chaired the union’s Ford bargaining committee, in a release.

Talks kicked off in August between Unifor and General Motors, Fiat Chrysler Automobiles and Ford. Workers approved contracts at GM and Fiat Chrysler in September and October.

The labor agreements each promise hundreds of millions in new investment in the automakers’ Canadian operations, in some cases contingent on government support.

The Ford contract closely resembles the GM and Fiat Chrysler agreements, and covers workers at Ford’s Windsor, Ontario, engine plants and some office and warehouse employees in Windsor and Edmonton, Alberta, as well as the Oakville assembly.

Workers will get $12,000 in bonus payments over four years, and 2% raises in the first and fourth years of the agreement.

Ford has promised to invest C$713 million ($533 million) in its Canadian operations, including C$613 million in Windsor, the union said in a pamphlet distributed ahead of the vote. The investment will update production of a V8 engine and add assembly of a new fuel-efficient motor for large pickup trucks, two sources familiar with the matter told Reuters.

For more on auto workers’ unions, watch Fortune’s video:

But the deal maintains a 10-year wage progression for new hires that is unpopular with some Ford workers, especially in Oakville. It also includes a significant concession on pensions, offering new hires a defined contribution pension plan, instead of a plan that guarantees some benefits no matter how pension investments perform.

In a public letter and interview in early October, Thomas said a deal similar to the one approved at GM would likely be rejected in Oakville, where 5,000 of the union’s nearly 7,000 Ford employees work. But ahead of the vote, he and other local union leaders endorsed the tentative contract.

The union practices pattern bargaining, selecting one of the three automakers to negotiate with first, and then insisting rivals agree to broadly similar deals.

Ahead of bargaining, union leaders said securing new investment would be their top priority in talks.

Separately on Sunday, Unifor members at Magna International’s Integram seating unit rejected a tentative agreement, triggering a strike.