WASHINGTON (Reuters) - The U.S. Senate passed legislation on Friday to fund the government through April and President Barack Obama promptly signed it into law, after Democrats who had sought more generous healthcare benefits for coal miners stopped delaying action on the measure.

The U.S. Capitol dome is pictured in the pre-dawn darkness in Washington in this file general view photo taken October 18, 2013. REUTERS/Jonathan Ernst/Files

Many government services and operations would have been closed or suspended at midnight, when current funding authority expired, if the Senate had not approved the bill. The vote was 63-36.

The House of Representatives passed the legislation on Thursday.

Obama signed the measure, the White House said in a statement issued about 90 minutes after the Senate passed it.

Democrats from coal-producing states, led by West Virginia Senator Joe Manchin, had delayed the Senate vote on the funding bill in a failed attempt to get a bigger extension of miners’ healthcare benefits that expire at the end of this year.

The Democratic senators, many of whom are up for re-election in 2018, seemed eager to court blue-collar voters who flocked to Republican President-elect Donald Trump in elections last month. Some of the senators also appealed to Trump to help the miners.

Trump “won coal country big, that’s for sure,” incoming Senate Democratic Leader Chuck Schumer said on the Senate floor.

“So we are simply asking our president-elect, to communicate to the people in his party, to get on board, live up to the promise we made the miners many years, decades ago,” Schumer said.

The legislation provided financial support for four more months of healthcare benefits for coal miners, through April, but Manchin and other Senate Democrats wanted at least a year.

Senate Republicans refused to reopen the issue. But Schumer said that Senate Majority Leader Mitch McConnell had promised Manchin he would work next year to continue the benefits beyond April. Manchin and the other Democrats then stopped objecting to holding the vote, although they still opposed the measure.

“I was born in a family of coal miners,” Manchin said. “And (if) I’m not going to stand up for them, who is?”

Manchin, a moderate Democrat who has been touted as a possible member of Trump’s cabinet, is scheduled to see Trump in New York on Monday. Manchin told reporters, however, that “I’m not looking for a job.”

The government funding bill would keep federal agencies funded until April 28. It freezes most spending at current levels.

Flint, Michigan, which has endured a two-and-a-half-year struggle with lead-contaminated drinking water, would get access to a $170 million fund for infrastructure improvements and lead poisoning prevention under the bill.

The Senate also passed a separate bill authorizing water projects around the country that included directions for spending the Flint money and provisions to provide relief to drought-stricken California. This measure was also approved by the House on Thursday.

A provision in the government funding bill would make it easier for Trump to win confirmation of General James Mattis to be defense secretary early next year.

Republicans demanded it to help Mattis get around a requirement that the defense secretary be a civilian for seven years before taking the job. Mattis retired from the military in 2013.