The Senate on Dec. 2 passed a Republican bill overhauling the tax code. The bill passed by a 51-49 vote. (Bastien Inzaurralde/The Washington Post)

The Senate Republicans’ chaotic late-night vote Friday to overhaul the tax system widened the country’s partisan divisions Saturday — sparking a political grudge match that lawmakers vowed to carry into next year’s midterm elections.

Democrats, united in their opposition, attacked the legislation as a “scam” passed to benefit wealthy donors and corporations. Republicans, promising years of wage and job growth once the bill becomes law, acknowledged that they face a difficult task convincing voters to have faith in a measure that received support from the GOP alone.

“They tend not to be popular,” Senate Majority Leader Mitch McConnell (R-Ky.), referring to bills passed with only one party’s support, told The Washington Post in an interview Saturday. “Generally speaking, in the beginning, people decide they don’t like it.”

The test for Republicans is whether they can convince voters that this legislation will put more money in their wallets — and the GOP leader is not sure whether they can do that in time for the 2018 elections.

“We don’t know,” McConnell said. But he said he thinks that in the long run, the economic boost will come and voters will eventually reward Republicans.

Sen. Bernie Sanders (I-Vt.) delivers a message via video to his supporters during the Protecting Working Families Tour at the Galt House Hotel on Dec. 1 in Louisville. (Stephen Cohen/Getty Images for Moveon.Org)

“Whether it’s immediately popular or not becomes irrelevant if it does what you hope,” he added.

Just hours after the vote, Sen. Bernie Sanders (I-Vt.), who ever since his unsuccessful bid for the 2016 Democratic presidential nomination has been a leading voice pushing the party to the left on economic matters, demonstrated his intention to make the tax bill a marquee issue in 2018.

Sanders headed to the airport for an urgent trip across the Midwest, starting at Dayton’s Masonic Temple to try to rally 1,300 supporters against the bill, and telling them they could still defeat it when a conference committee is formed to combine differing House and Senate packages.

“The president was lying to you,” Sanders said. “This is class warfare, and we’re going to stand up and fight.”

The back and forth Saturday showed the opportunities — and challenges — for each side as they stake their political ground on taxes.

Democrats see an opening for an attack on President Trump and Republicans as allies of the wealthy and Wall Street interests. Republicans, who watched Trump capture an antiestablishment populist mood in 2016, may find it difficult to sell a tax bill that was underwater in polls even before the mostly party-line vote on the Senate measure.

Several at-risk Democrats, including Sen. Jon Tester (Mont.), recorded viral videos to dramatize how late the bill had been printed, and how some revisions had been written in hard-to-read pen scratches.

“Take a look at this, folks. This is your government at work,” Tester said, slamming his fist on the bill. “It’s going to shift money from middle-class families to the rich, and we were given it 20 minutes ago.”

Trump and GOP leaders, enthused after their first major legislative victory of the year, have forcefully defended the measure.

McConnell on Saturday dismissed complaints about last-minute additions to the legislation and handwritten notes indicating what it would do. “Sounds familiar to the final days of Obamacare — handwritten things and the Cornhusker Kickback,” he said, comparing a provision to secure the vote of a senator from Nebraska on health care to a flare-up over a narrow provision written into the new tax bill to benefit just one conservative college.

In speeches, on social media and in TV ads, Republicans have described the legislation as the spark of a “middle-class miracle” that voters will see soon in their paychecks. The bill has largely unified the GOP, with even critics of the administration such as Sen. Jeff Flake (R-Ariz.) rallying to pass it.

“It’s time to pound away on growth, and don’t depart from that message,” said Larry Kudlow, a conservative economist and informal Trump adviser. “The message of growth and jobs and wage is hitting. As long as the GOP stays on that, they’ll be fine.”

While Democrats said they would tell voters that Republicans had passed a regressive tax reform measure before any of them had read it, Republicans predicted that the strategy would flop.

“Nobody believes them,” said former House speaker Newt Gingrich (Ga.), a close Trump ally. “Republicans should ignore it and get the bill through and count on the economy’s growth and the tax cut to carry them to victory next year.”

Veterans of President Barack Obama’s administration, with memories of how Republicans attacked the passage of the Affordable Care Act, argued that Republicans overly optimistic and had misread the national mood. Republicans were “deluding themselves,” said former Obama strategist David Axelrod, to think that voters would reward them for a tax cut.

“There are two categories of people who will benefit here — wealthy, corporate interests, of course, who scored a bonanza, and Democratic ad-makers, who have been handed a treasure trove of egregious targets and tawdry, swamp-like images with which to work,” Axelrod said.

The bill’s progress has not much resembled Washington’s last raids on the tax code. President Ronald Reagan’s 1981 tax cut passed by super-majorities in the House and the Senate, while President George W. Bush’s 2001 tax cut — sold at first as a way to spend a surplus, then as a way to combat a recession — attracted 13 Democratic votes in the House and 12 in the Senate. In 2010, an even larger number of Democrats voted to extend the Bush-era tax rates for people making less than $400,000, fearful that cutting them back would lengthen the Great Recession.

There was no such worry about the Tax Cuts and Jobs Act, which breaks from recent monetary history by reducing tax revenue in a time of steady economic growth — conditions in which prior Congresses have tried to reduce the deficit. The Joint Tax Committee estimated that the bill would add more than $1 trillion to the U.S. debt over 10 years; Democrats, attacked for years over the growing national debt, marveled as just one Republican, Sen. Bob Corker (Tenn.), voted against the bill.

Democrats have found solace in public polling.

A polling average compiled by FiveThirtyEight found that 46 percent of the public opposes the Tax Cuts and Jobs Act, compared to 32 percent who support it. That makes it slightly less popular than the 1993 tax increase that helped Republicans seize Congress from President Bill Clinton’s Democrats.

Guy Cecil, the president of Priorities USA, said surveys show that voters will respond negatively when they learn the details of the legislation.

“When Americans find out that the wealthy and big corporations are getting most of the benefits, they oppose it, even when they get something small as well,” Cecil said.

Republicans were confident that the public would move once the new tax code took effect. Trump, who has inaccurately said that the bill would tax the very wealthy to help working-class Americans, has predicted an economic boom that would lead quickly to employers raising wages.

“Middle-class families will not only see their tax bill go down, they will see their incomes go up by an average of around $4,000,” Trump said last week in St. Charles, Mo. “That’s because we’re going to cut taxes on American businesses so they will compete for workers, they’ll raise salaries.”

Democrats see it differently, with the tax bill at the center of their increasingly populist campaign. In Ohio, where Sanders headlined two Saturday rallies, former Consumer Finance Protection Bureau director Richard Cordray, who is widely expected to run for governor, warned middle-class voters that the Trump administration is making it easier to bilk them. Democrats spent Monday and Tuesday attacking the Trump administration for installing Office of Management and Budget Director Mick Mulvaney atop the agency, and before that, railed against Republicans for undoing a CFPB rule that made it easier to sue banks.

Sen. Sherrod Brown (D-Ohio), who is up for reelection in 2018, said he plans to use all facets of Trump’s regulatory and tax policies to make a case against him and the Republican-controlled Congress.

“The public by election day will see how this Republican majority is wholly owned by Wall Street on every issue and the administration increasingly resembles a retreat for Goldman Sachs executives,” Brown said in an interview. “Whatever plays into that, whether it’s going after the overtime rule or giving all kinds of breaks to Wall Street, or relaxing environmental rules to clean up Lake Erie, you’ll see what this will all be framed by.”

Dayton was one place where Brown would test his theories. In 2016, Trump became the first Republican in 28 years to carry the surrounding Montgomery County, campaigning in the city on a promise to bring back manufacturing jobs. Local Democrats, who had organized protests of the bill, said that the measure risked the “feds, meds and eds” jobs — government, health care and education — that had fueled the area’s comeback.

“Who actually wants this thing?” asked Nan Whaley, the mayor of Dayton, who’s running for the Democratic nomination for governor. “The Realtors, the governors, the mayors, the universities, the hospitals — they don’t want it. Who does, except their donors?”

Costa and Kane reported from Washington. Scott Clement in Washington contributed to this report.