The U.S. Senate passed the most sweeping rewrite of the nation's tax laws in more than three decades early Wednesday, all but ensuring the bill will soon become law.

The vote also likely helped hand President Donald Trump and congressional Republicans a major year-end legislative triumph.

The final vote, shortly before 1 a.m. EST, was 51-48, with no Democrats voting in favor of the bill and all Republicans supporting it.

Only U.S. Sen. John McCain, R-Ariz., who had announced his support for the bill earlier this month, was not present for the vote. His office said he “looks forward to returning to Washington in January" as he recovers from brain cancer treatment.

The Senate's vote meant that Vice President Mike Pence, who had postponed a trip to the Middle East to be at the Capitol if needed, was not required to break a tie vote.

During the vote, protesters interrupted with chants of "kill the bill, don't kill us," and Pence repeatedly called for order.

Before Trump can sign the tax overhaul into law, the House of Representatives must re-vote because of procedural flaws in the chamber's vote earlier Tuesday.

The office of House Majority Leader Kevin McCarthy, R-Calif., said House members would reconsider the Senate's bill Wednesday morning and send it to President Trump for his signature.

The House voted 227-203 in favor of the tax bill Tuesday afternoon, but the package ran into trouble in the Senate because of two provisions that Democrats said ran afoul of the Senate's strict budget reconciliation rules.

In order to avoid a filibuster according to Senate rules, the tax overhaul must directly address fiscal issues, not policy matters. Matters that are considered extraneous to budget are subject to potential filibustering, meaning they would require 60 votes for passage, instead of a 51-vote majority.

Senate Democrats, including Vermont independent Bernie Sanders and Oregon's Ron Wyden, specifically objected to two provisions in the House bill: one providing for the use of 529 savings accounts for home schooling expenses; and the other establishing criteria to determine whether endowments of private universities are subject to the legislation’s new excise tax.

Additionally, Democrats objected to the name of the House bill.

The Senate parliamentarian reportedly sided with Democrats, forcing the Senate to remove those provisions before the vote.

Top Democrats charged that the procedural snafu was a sign that Republicans were rushing the legislation through Congress.

“The House revote is the latest evidence of just how shoddily written the GOP tax scam really is," House Democratic leader Nancy Pelosi said in a statement.

The complex legislation, weeks in the making, scales back the popular deduction for state and local taxes, bad news for Americans in some of the wealthiest suburbs of New York, New Jersey and California.

The bill preserves the deduction for medical expenses, rebuffing an effort by House Republicans to eliminate it.

It also provides steep tax cuts for businesses and wealthy families, and more modest reductions for low- and middle-income families.

The Associated Press contributed to this report.