The US Senate has approved the most sweeping overhaul of the US tax system in more than three decades.
Republicans say the tax cuts for corporations, small businesses and individuals will boost economic growth.
Democrats, who all voted against it, say it is designed to benefit the ultra-rich at the expense of the national deficit.
For final approval, the legislation must go back to the House on Wednesday for a procedural issue.
If it passes, as expected, it will be President Donald Trump’s first major legislative triumph.
Vice-President Mike Pence presided over the vote and announced the result.
“On this vote the ayes are 51, the nays are 48. The Tax Cuts and Jobs Act is passed,” he said.
Shortly before the final tally was announced, protesters in the Senate’s public gallery shouted “kill the bill”. They were escorted out.
What will the bill do?
Corporate taxes will pay 21%, instead of the current rate of 35%.
It will also lower individual tax rates, albeit temporarily.
Other key elements include:
- Less inheritance tax
- An expanded child tax credit
- Lower taxes on overseas profits
The bill’s final passing hit a last-minute glitch when it was found that three procedural rules had been violated. As small changes to the wording were made, it now needs to return to the House of Representatives to be approved again.
The House earlier approved the bill comfortably. Republicans have majorities in both houses of Congress.
Who are the winners and losers?
It is good news for businesses, particularly multinational corporations and the commercial property industry.
The extremely wealthy and parents sending their children to private schools are set to benefit.
However, families living in high-tax, high-cost states could lose out, so could those paying for their own health insurance.
In the immediate future, the plan will see the vast majority of tax payers having lower tax bills, but the cuts expire in 2025.
By 2027, the Tax Policy Center estimates that the overall change would be negligible. And 53% of taxpayers would face higher bills, many of them in the lower income brackets.
Why are Arctic animals also losing?
Republicans attached a measure to the tax bill that opens drilling in parts of the Arctic that have been protected for environmental reasons since 1960.
Analysis: One final swoop
By Anthony Zurcher, BBC North America reporter
It wasn’t easy, but in one fell legislative swoop, Republicans have achieved some long-sought political goals.
Subject to a vote in the House early on Wednesday, they have reduced taxes by more than $1.4 trillion (£1tn) over 10 years, including significant changes to the corporate tax structure.
Congressional conservatives also opened the Arctic National Wildlife Refuge to oil drilling – a pitched partisan battle for years. And it set a bomb at the heart of Obamacare by ending the tax penalty for those who don’t have medical insurance starting in 2019.
What one Congress can do another can undo, of course, and the task ahead for Republicans is selling a sceptical public on the benefits of their plan.
While they may argue that Americans will come around once they see lower tax bills, many may have already made up their mind.
Like Obamacare eight years ago, this tax legislation was passed by partisan muscle alone. And like that law, many Americans view the legislation as largely benefitting others. They will be difficult to convince otherwise.
Repealing key provisions of this tax law will be as uniting for Democrats as healthcare repeal was for conservatives.
Donald Trump and Republicans have their victories. They will have to fight to keep them.