WASHINGTON — The House and Senate approved the most significant overhaul of the tax code in three decades, but Republicans will have to clear one more legislative hurdle before they can claim their first major legislative win and deliver the $1.5 trillion package to President Trump before Christmas, as he requested.

The GOP’s sweeping tax measure hit a glitch late Tuesday afternoon in the Senate when the parliamentarian ruled that three minor provisions included in the House-passed bill did not comply with the Senate’s strict budget rules. It was a momentary but onerous setback that forced Senate Republicans to strip the three provisions out of the bill and send it back to the House for yet another vote—putting a damper the GOP’s jubilation as they rush to finish other year-end business.

The House is expected to vote on the tweaked tax package Wednesday morning—with the outcome likely to mirror Tuesday’s 227-to-203 House vote. That tally split mostly along party lines and came after a brief but heated debate, which was interrupted several times by protesters chanting "Kill the bill! Kill the bill!" before being escorted from the House gallery.

Another round of protests erupted when the Senate began voting on the measure just after midnight on Wednesday. With Vice President Mike Pence presiding, the tax bill squeaked through the Senate near 1 a.m., on a 51-48 vote, after the offending provisions were dropped. Sen. John McCain, R-Ariz., was absent; he has been diagnosed with brain cancer and is at home recovering from treatment.

"This is a once in a generation opportunity," said Senate Majority Leader Mitch McConnell, R-Ky.

It was also a years-in-the-making moment for House Speaker Paul Ryan, R-Wis., who has spent nearly 20 years advocating for tax reform. Ryan took the rare opportunity to preside over the chamber for the vote, banging the gavel and joyfully reading the final vote total, as his Republican colleagues erupted in cheers.

“This is one of the most important pieces of legislation that Congress has passed in decades to help the American worker, to help grow the American economy,” Ryan said at a news conference after the House vote. “This is profound change … On January 1, Americans are going to wake up with a new tax code."

The centerpiece of the GOP bill is a permanent 40% tax cut for corporations, a change Republicans say is long overdue and desperately needed to make America more competitive in the global economy. Smaller businesses will also see their tax burden shrink significantly.

Supporters said the cost of reducing tax collections by $1.5 trillion over the next 10 years would be offset by an explosion of economic growth, but economists said at best that growth will cover one-third of the cost. Non-partisan estimates project the tax bill could add $1 trillion to the national debt over 10 years. And laws designed to prevent deficit spending could kick in as early as next year, forcing cuts to popular programs, including Medicare.

The bill will also lower tax rates for individuals and families temporarily, while increasing the standard deduction and the child tax credit. But because the bill also kills or limits key tax deductions — most notably rolling back the ability of individuals to subtract their state and local taxes from their federal tax bill — the impact on individuals will vary.

In a study released on Monday, the Tax Policy Center, a nonpartisan think tank often cited by Democrats, concluded that the top 1% of taxpayers, those making more than $732,800, would get 20.5% of all the benefits in the tax bill next year.

The study also found that for people in the middle of the national income scale — making between $48,600 and $86,100 — 91% will see a tax cut averaging $1,090, while 7% will see a tax increase averaging $910 next year.

“This GOP tax scam is simply theft — monumental, brazen theft from the American middle class and from every person who aspires to reach it," House Minority Leader Nancy Pelosi, D-Calif., said during the House debate Tuesday.

Other Democrats noted that the bill is projected to plump up the nation's $20 trillion debt and cast the Republican bill as fiscally irresponsible.

"Who are they fooling with this bill?" Rep. Rosa DeLauro, D-Conn., said on the House floor. "This bill fails the middle class and benefits the richest 1 percent."

Republicans dismissed suggestions that the bill was skewed toward the wealthy.

“With this tax reform, families at every income level will get a tax cut,” Ryan told reporters Tuesday. “This is real relief and people are going to see this in their paycheck before too long.”

Ryan said he had “no concerns whatsoever” that the tax bill would turn into a political liability for the GOP as they head into the 2018 elections.

The tax plan has been deeply unpopular, according to numerous national polls. A Monmouth University Poll released on Monday, for example, found that Americans disapproved of the GOP bill by a nearly 2-to-1 margin; only 26% of respondents said they approved of the plan, while 47% said they didn’t like it.

Ryan said public opinion will shift once Americans start seeing bigger paychecks and more jobs.

“Results are going to make this popular,” Ryan said.

Democrats said the opposite would happen.

"Republicans will be running away from this bill in shame," Senate Minority Leader Charles Schumer, D-N.Y., said Tuesday. He said Republicans will use "the deficits they are about to create" as justification to go after Social Security and other safety-net programs.

"Our children and grandchildren will be asked to clean up the mess made tonight," he said.

The GOP legislation also strikes a major blow against the 2010 Affordable Care Act; it repeals that law's "individual mandate" requiring most Americans to obtain health insurance.

Republicans added that provision because it will save the federal government about $381 billion between 2018 and 2026, most of that from a decrease in Medicaid spending, according to a report from the nonpartisan Congressional Budget Office.

Democrats blasted that as an assault on low-income Americans who rely on Medicaid for their health insurance. They point to the CBO's analysis finding a repeal would lead to 4 million fewer people with insurance next year, 13 million fewer in 2027, and premium rate increases of about 10% for those who remain in the exchanges.

Republicans failed several times this year to pass legislation to repeal and replace Obamacare, but adding this provision to the tax bill gives them a partial success to tout on that long-standing promise.

Senate Republicans used special budget rules to fast-track the tax bill and block a Democratic filibuster. But those rules mandate that every element of the bill has to have a budgetary impact. The Democrats asked the Senate parliamentarian to scour the bill for problematic provisions, and she found three — all relatively minor items.

One provision would allow 529 college savings accounts to be used for home-schooling expenses. Another sets criteria to determine if private universities’ endowments will be subject to a new excise tax. The third is even more mundane: the short title of the bill — “The Tax Cuts and Jobs Act” — has no budgetary impact and will have to be nixed.

Contributing: Herb Jackson