WARREN, Mich. — Line workers rolled into the Motor City Sports Bar & Grill after their shift ended, clinking Budweiser bottles, playing billiards and trying to talk above a loud mix of rap and country music.

Workers at the nearby GM transmission plant come to this restaurant for lunch, happy hour or to get an early start on the weekend. But this was no typical Friday. For many of the workers, it was their final day at the 78-year-old plant.

“It was a little somber. It was a little bittersweet when the last transmission rolled out,” said Jack Arnold, 49, who has worked on the assembly line for more than two decades.

“Getting a job at GM 23 years ago, for me, it was like winning the lottery,” he said. “I was trying to start a family. It kept my now ex-wife at home to raise the children. I was able to buy a house. We went to Disney World — all of that.”

The closure of the plant — one of five GM factories being closed in North America by the end of 2019 — is upending hundreds of lives here.

The factories all make parts for or assemble passenger cars such as the Chevrolet Impala and Cadillac XTS that GM is discontinuing in response to changing consumer preferences. It’s part of a broader restructuring that is expected to provide the company$6 billion in cash flow by the end of next year.

But it also has political ramifications. The moves come about a decade after the company filed for bankruptcy and received a roughly $50-billion bailout from the U.S. government. The rescue effort saved large numbers of jobs, but tax-payers ultimately lost $11.2 billion.

The 2.1-million-square-foot Warren plant closure is also taking place in a county and a state that are crucial in determining who wins the White House in 2020.

The factory’s official closure date is Thursday, the day after the two-night Democratic presidential debate in Detroit, 10 miles south of here. The plant’s home, Macomb County, is a bellwether that President Trump carried by nearly 12 points in 2016 and President Obama won in the two prior elections.

Maria Nuculaj, the restaurant’s owner, who is not affiliated with a political party, is among those who twice voted for Obama before voting for Trump in 2016. She recalled Trump coming to Warren and nearby Sterling Heights days before the election and promising to stop the bleeding of manufacturing jobs that was hammering the middle class.

“I liked that he said the jobs would stay here. That made me feel more secure,” Nuculaj said. “But then I hear [about the plant closing]. What the hell is going on?” Nuculaj added that she would not vote for Trump in 2020.

The closures of the Warren plant and the larger Detroit-Hamtramck Assembly factory — another GM facility that has produced 4 million cars since 1985 — will have ripple effects on the surrounding communities, and are predicted to mean 16,000 fewer jobs in Michigan over the next two years, according to a report prepared for state lawmakers earlier this year by University of Michigan economists.

Nearly half of Nuculaj’s customers work at the Warren plant, and if they stop coming, she may have to reduce her staff of 11 cooks, waitresses and bartenders, she said. But the factory loss isalso personal.

“We know them. They tell us stories about their families, everything. It’s just so sad, so very sad,” she said. When she heard Friday was their last day, she considered decorating the bar with balloons or bringing in cake but decided it was inappropriate. “I don’t think it’s a celebration.”

Like many in the region, Nuculaj has multiple ties to the auto industry. Her father, an immigrant from Montenegro, supported their family of eight by working at a Dodge factory. Her husband worked at an axle maker, first seeing his wages cut in half before the factory closed and relocated to Mexico in the mid-2000s. Two of her three sons work for automakers.

“I tell them, ‘Save your money because you never know what’s going to happen,’ ” she said.

Democrats have seized upon plant closures in Michigan, Ohio and elsewhere to argue that Trump’s economy has failed workers. Priorities USA, a super PAC that supports Democrats and can take unlimited donations, is spending more than $300,000 weekly on digital ads hammering the message in key states.

Republicans point to the nation’s low unemployment rate — 4.2% in Michigan in June — as proof that the president’s economic policy is working.

However, even some supportive of the president say these numbers gloss over how the nature of work has changed.

Dave Patterson, a construction worker playing pool in the corner of the restaurant who hopes Trump is elected to a second term, said his 26-year-old son makes $11 per hour as a lube tech mechanic at a GM Buick dealership. Patterson, 52, said he made twice that wage as a carpenter’s apprentice at the same age.

“There’s no way he could ever afford an apartment or afford his own groceries without my help,” he said.

But many of the workers are skeptical whether elected leaders of either party have the ability — or the will — to do anything about the declines in the Rust Belt, given globalization, automation, the nation’s trade policies and the weakening of labor unions.

“I don’t believe it’s on the agenda. I think the table has been set,” said Clarence Heath, who has worked for GM for 19 years.

He noted the two Michigan plants being closed are the closest to GM’s towering global headquarters on the waterfront in Detroit.

“They wouldn’t have been able to do that in the ’70s or ’80s,” said Heath, 52, speaking of a time when unions had larger memberships and weren’t being whittled down by legislative and legal rulings that limit their numbers.

The workers at these plants rarely had more than a high school education. But through hard physical labor — that sometimes led to debilitating injuries — they earned wages, benefits and pensions that placed them squarely in the middle class. Less than a quarter of Macomb County residents complete college, yet when many of the line workers like Heath talk about dealing with the plant closure, it’s in the context of paying for their children’s college tuition bills.

Heath and other laid-off workers played keno, watched Nascar and eyed the specials — $2.50 chili-swathed hot dogs and $2 Miller Lite bottles — as they pondered their fates. Some will have the opportunity to transfer to other GM plants in Michigan and other states and didn’t want to jeopardize their chances by speaking out publicly. Others were simply not ready to talk about how the closure would change their lives.

“I’m too emotional,” said a 67-year-old woman who has worked for the company for four decades. She was among a group of women who prayed on the factory floor Friday morning. Others crowded around the last transmission to roll off the line — bound for a 2019 Chevrolet Impala — and signed it.

“All I can say is I love everybody. It’s a family. We’re all one big family,” she said. “How would you feel if your family was broken up and they don’t know where they’re going?”

Some have accepted posts as far away as Bowling Green, Ky. Others, like Arnold, will be starting on Monday at the factory in Flint, Mich., where the company is adding jobs to increase production of full-size trucks.

Marcus Fields, 56, is retiring.

“Today’s my last day,” said Fields, who has worked for GM for 35 years. “I never expected it to end this way. If the plant was still open, I would stay. I don’t want to go driving way out somewhere else, or learning to do another job somewhere else.”