Sen. Charles E. Schumer (D-N.Y.) and other Senate Democrats on Capitol Hill on Nov. 16. (Andrew Harnik/Associated Press)

The Senate voted late Friday night to approve a must-pass spending bill, ending the threat of a short-term government shutdown.

The 63-to-36 vote to approve the year-end legislation came less than an hour before the midnight deadline.

Democrats used a standoff over the year-end spending bill to appeal to the working-class white voters they lost to President-elect Donald Trump by threatening a short government shutdown over health-care benefits for coal miners.

Red-state Democrats up for reelection in 2018 forced the showdown and late-night vote to insist on health-care benefits for retired coal miners and requiring the use of U.S. steel in infrastructure projects.

Democrats said they would continue to press these issues when Congress returns early next year.

“If you’re alive today, for most of your life, over 50 percent of your energy has been given to you, has been delivered to you because of coal,” Sen. Joe Manchin III (D-W.Va.), who led the effort to delay he bill, said on the Senate floor. “We need to bring attention to the people who have done the work. They’re forgotten heroes. In West Virginia we feel like a Vietnam returning veteran. We’ve done everything that our country has asked of you, and now you won’t even recognize us, don’t even understand what we’ve done.”

“That’s what we’re fighting for,” he said.

The fight is the first sign of an emerging strategy for Democrats who are looking to force their Republican counterparts to respond to Trump’s campaign promises. Forcing the coal-country fight into the government spending debate allowed Democrats to publicly shame Republicans — although it’s unclear where Trump stands on the measure.

Incoming Senate Minority Leader Charles E. Schumer told reporters Thursday that the issue could easily unite Democrats and Trump.

“I hope our new president-elect, who talked and got to know the miners, will speak out,” Schumer said. “We don’t care about partisanship.”

Senate Democrats also wanted funding for the “Buy American” program included in a water resources bill that is slated to come up for a Senate vote after the spending bill is complete. Republicans have been willing to support the provision as part of temporary spending bills but have resisted including it in more-permanent legislation such as the water bill.

That tension puts Republicans at odds with Trump, who backed the concept at a rally last week.

“Whether it’s producing steel, building cars or curing disease, we want the next generation of innovation and production to happen right here in America and right here in Ohio, right?” Trump said in Cincinnati.

Senate Democrats wanted Majority Leader Mitch McConnell (R), who hails from Kentucky, a big coal-mining state, to agree to a one-year extension of a program to help fund health care for miners. No deal was struck, but McConnell has said that he plans to address the issue next year before the benefits expire.

Manchin — a candidate for energy secretary in Trump’s Cabinet — canceled a scheduled Friday meeting with the president-elect to continue negotiations in Washington, but he is expected to visit Trump Tower on Monday. Manchin has been joined in the push by Sens. Heidi Heitkamp (D-N.D.), Robert P. Casey Jr. (D-Pa.), Sherrod Brown (D-Ohio), Mark R. Warner (D-Va.) and Claire McCaskill (D-Mo.). All but Warner are up for reelection in states that Trump won.

The measure would affect about 23,000 miners and retired miners who get health-care coverage from plans that are running out of money. Approximately 60 percent of those retired miners were employed by companies that are no longer in the mining business and therefore don’t have current employees to help support the fund.

“We are at stand up or shut up,” Manchin said at a news conference Thursday night.

Heitkamp called out Trump by name as she left a Thursday meeting between Senate Minority Leader Harry M. Reid (D-Nev.) and several of the Democrats who represent states Trump won.

“We think there has been a renewed interest in these kind of issues with President-elect Donald Trump,” said Heitkamp, who recently met with him in New York. “We’re hopeful that we’ll be able to get relief and be able to deliver a Christmas present to some of the most sympathetic working people in America.”

Republicans have taken note of which Democrats led this fight and which bloc of voters this issue would appeal to in the midterm elections two years from now.

“You’ve got to look at the people who are doing it, and Senator Brown and Senator Manchin are both up in 2018,” Sen. John Cornyn (Tex.), the No. 2 Republican in the Senate leadership, told reporters Thursday. “Obviously they’d like to show they’re fighting on behalf of their constituents.”

Other Democrats, including Casey and Heitkamp, who have taken lead roles are also up in 2018. Trump won many of their states in last month’s presidential election — ranging from the narrowest of margins in Pennsylvania, less than one percentage point above Hillary Clinton, to an overwhelming margin of 42 percentage points in Manchin’s West Virginia.

Trump won those states by running up huge margins among white working-class voters, including many union workers or former union members whose support these Democrats will need to win back to get reelected. In that regard, some Democrats say that they believe their stand trying to help mine workers — a symbolic embodiment of the white working class — might demonstrate to those voters now that they have not been forgotten by senators facing reelection in 2018.

One senator suggested that the Midwestern Democrats initially acted on their own to start this fight in the middle of what is a slightly awkward vacuum at the top of the caucus, with Reid retiring this week amid many gala celebrations and his trusted deputy, Schumer, still being deferential to Reid until he formally leaves office.

In recent days, Schumer became more involved in the strategy and worked closely with the Democrats who are up for reelection in 2018 — many of whom hold special significance to him because they were first elected in 2006 when Schumer was the party’s campaign chief.

Paul Kane and Mike DeBonis contributed to this report.