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.
The United States Senate just passed the biggest in history Tax Cut and Reform Bill. Terrible Individual Mandate (ObamaCare)Repealed. Goes to the House tomorrow morning for final vote. If approved, there will be a News Conference at The White House at approximately 1:00 P.M.— Donald J. Trump (@realDonaldTrump) December 20, 2017
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 be set at 21%, instead of the current rate of 35%.
The bill 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
Parties strictly divided
The vote has kept to party lines: Republicans in favour, Democrats in protest.
Republicans have majorities in both houses of Congress. The House earlier approved the bill comfortably, 227 to 203. In the Senate, it was 51 to 48.
Democrat leader Chuck Schumer warned Republicans that they would pay a price for the "awful legislation" in next year's mid-term elections.
"The substance and polling are so rotten that a year from now Republicans will be running from this bill in shame for voting yes this evening," he said.
Speaker Paul Ryan remained wholly enthusiastic, saying: "Today we are giving the people of this country their money back. This is their money after all!"
Who are the winners and losers?
The tax reform 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.
It could also be bad news for Alaskan animals as the bill attached a measure to open drilling in parts of the Arctic that have been protected for environmental reasons since 1960.
What happens next?
The bill's final passing hit a last-minute hurdle 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.
Some democrats say it is the speed at which the bill has been put together that caused the final hitch.
"The House re-vote is the latest evidence of just how shoddily written the GOP tax scam really is," House Democratic leader Nancy Pelosi said in a statement.
Republicans insist that such a major overhaul will always have hiccups, which are just part of the procedure.
"Listen, people screw up. A member of the staff screwed up. It's not the end of Western civilisation," Republican Senator John Kennedy told MSNBC, according to Reuters news agency.
Analysis: One final swoop
By Anthony Zurcher, BBC North America reporter
It wasn't exactly easy, but President Trump now has his signature legislative achievement. The self-styled dealmaker-in-chief was finally able to flex his party's majority muscle, overcoming internal dissent to accomplish some long-sought political goals.
Subject to a vote in the House early on Wednesday, Republicans 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.
How is the rest of the world affected?
The predicted boost for business has caused the stock market to soar in recent weeks. US economic growth is also expected to have a knock-on effect around the world.
As a result of the reforms, US companies with offshore dealings could decide to keep their money at home, enticed by lower corporation taxes plus a desire to avoid new restrictions on shifting profits abroad.
Companies operating overseas, such as big tech and pharma companies, would be taxed at a low rate - 15.5% - to return the cash to the US in a one-time move.
Ireland, where Apple has a major base, still undercuts the US with its headline corporation tax rate of 12.5%.