A contentious 40-day strike that crippled General Motors’ U.S. production came to an end Friday as workers approved a new contract with the company.

The four-year deal will now be used as a template in bargaining with crosstown rival Ford Motor Co., the union’s choice for the next round of bargaining, followed by Fiat Chrysler.

GM workers voted 57.2% in favor of the pact, passing it with a vote of 23,389 to 17,501, the union said in a statement.

Picket lines came down almost immediately after the vote was announced, and some of the 49,000 striking workers were expected to return to their jobs as early as Friday night. Some skilled trades employees such as electricians and machinists were to enter the plants to get machinery restarted in preparation for production workers to return as early as Saturday.

“It was a good vacation, but I guess I’ve got to go back,” joked Paul Daru, a 42-year worker at GM’s engine and transmission plant in Romulus, Michigan, near Detroit. “I miss the socializing and stuff like that, seeing the guys, going out on the job and figuring out what the problem is.”

Although workers at his factory approved the deal, Daru said he voted against it because it still has several different pay scales for workers doing the same jobs. “Somebody who is working next to you for 17 bucks per hour, you’re doing the same thing,” said Daru, an electrician who may go back to work Saturday.

Temporary workers can get permanent jobs after two or three years depending on their start dates, but they start at the bottom of a pay scale, so people doing the same work can end up at different pay rates.

The deal also includes a mix of wage increases and lump-sum payments and an $11,000 signing bonus. But it allows GM to close three U.S. factories, a point of contention for many of the 42.8% of workers who voted no.

The five-week walkout was big enough to help push down September U.S. durable goods orders by 1.1%, the largest drop in four months.

“We delivered a contract that recognizes our employees for the important contributions they make to the overall success of the company, with a strong wage and benefit package and additional investment and job growth in our U.S. operations,” GM CEO Mary Barra said in a statement.

Tricia Pruitt, another worker in Romulus, said the wage gains were worth staying off the job for more than five weeks, but she’s ready to return to work.

Pruitt, a 15-year GM employee, was happy that the contract brings workers hired after 2007 up to the same wage as older workers in four years.

Although GM dealers had stocked up on vehicles before the strike and many still have decent supplies, analysts say GM won’t be able to make up for the lost production. Had the strike been shorter, GM could have increased assembly line speeds and worked the plants on overtime to catch up and refill its stock. But many of the plants that make popular SUVs and pickup trucks already were working around the clock to keep up with demand before the strike began.

Also, companies that supply parts to the factories and halted production during the strike will need time to restart, although GM has some parts in stock.

Jeff Schuster, senior vice president of the consulting firm LMC Automotive, estimates that GM has lost production of 300,000 vehicles, and he said maybe only a quarter of it can be made up.

Some production losses will help thin inventory, especially of cars, Schuster said. But in late October and early November, GM will likely run short of colors and models of trucks and SUVs that are in high demand until stocks are replenished, he said. Although truck and SUV buyers generally are loyal to a brand, customers in a hurry for a new vehicle could go elsewhere, Schuster said.

“There are definitely going to be some limitations on choice, and that is a risk,” Schuster said. “Consumers can opt to wait, or they can go down the street to their competitor.”

With bargaining shifting to Ford, it’s not clear whether there will be another strike, but it’s unlikely Ford or Fiat Chrysler will like the terms of the GM contract.

GM traded the ability to close the three factories in Lordstown, Ohio; Warren, Michigan; and near Baltimore for higher labor costs, David Kudla, chief investment strategist for Mainstay Capital Management of Grand Blanc, Michigan, wrote in a note to investors. The contract maintains worker health benefits with low premiums, something that both Ford and FCA wanted to change when negotiations began.

“Ford and FCA didn’t have three factories that they wanted to close, but will have to work around this new framework for higher wages and unchanged health care that the UAW and GM have set,” wrote Kudla.

Workers from the closed factories campaigned against the contract, with several plants voting against it. But in the end, economic gains and a $7.7 billion GM investment pledge for U.S. factories were too much to turn down.

Tim O’Hara, president of the UAW local in Lordstown, said workers there overwhelmingly voted down the deal, disappointed that they didn’t get a new vehicle to keep the plant open. Many Lordstown workers were transferred to other factories, and they campaigned against the contract at their new jobs, he said.

Thousands of ex-Lordstown workers were hoping they could someday return to their homes, he said. “A lot of our people did have plans that they could come back in possibly a year or even three years,” O’Hara said. “Now that’s gone. They have to draw up a whole new game plan.”

© The Associated Press. All rights reserved.