Media playback is unsupported on your device Media caption President Trump: "It's the largest tax decrease in the history of our country by far"

US senators have passed a sweeping tax cuts bill, paving the way for Donald Trump's first big legislative victory.

The package would mark the biggest tax overhaul since the 1980s. It was passed by 51 votes to 49, after a series of amendments in a marathon session.

Democrats complained it only benefited the wealthy and big business.

The plan sees a sharp cut in corporation tax, but a Senate committee finding has warned it would add $1tn (£742bn) to the budget deficit.

President Trump wants the measures enacted by the end of the year and he congratulated Republicans for taking the US "one step closer to delivering massive tax cuts for working families".

The Senate will now have to merge its legislation with that passed last month by the House of Representatives, before it can be signed into law by the president.

On Saturday, a triumphant Mr Trump told supporters at a New York fundraiser: "So last night we passed in the history of the country, the largest tax cuts and reform... what we're doing is, if you look at it, we're going to grow the country, we're going to grow jobs. We're going to be growing everything."

Image copyright AFP Image caption Republican majority leader Mitch McConnell overcame a pocket of Republican resistance to get the bill through

The move is as a major victory for Mr Trump, who since taking office has struggled to get major legislative movement in Congress - including fulfilling his vow to repeal and replace Obamacare.

His presidency has also been dogged by an independent investigation into Russian attempts to influence the 2016 US election and possible collusion with his campaign team. On Friday, ex-national security adviser Michael Flynn became the Trump administration's most senior member to be charged in the investigation.

Media playback is unsupported on your device Media caption Trump on Russia inquiry: "What has been shown is no collusion"

How did we get here?

Analysis: Anthony Zurcher, BBC News, Washington

The US Senate, a seemingly insurmountable roadblock for the Republican agenda for much of this year, has at last given its assent to a major piece of legislation.

Perhaps unsurprisingly it was sweeping tax cuts - always beloved by conservatives - that finally brought the party together and gave President Donald Trump the opportunity to claim a landmark legislative achievement.

It wasn't always pretty. Senate negotiators were handwriting amendments to the massive bill practically up until the final votes were taken. Deals within deals were cut to satisfy recalcitrant legislators. Democrats howled at the permanent cuts provided to corporations, while middle-class taxpayer benefits had sunset clauses.

In the end, however, a combination of hope and fear were enough to drag a slim majority into the yes column. The hope is that a booming economy will give Republicans a chance to run on their tax policy when they stand before voters next November. The fear was that yet another failure would have led to a revolt among the party's big donors and traditional business constituencies.

The House and Senate must now smooth out differences in their bills and vote on the compromise. It's not the end of the race, but the finish line is in sight.

What's in the new tax bill?

Presiding over the Senate, Vice-President Mike Pence declared the 51-49 victory to applause from Republicans in the early hours of Saturday morning.

The final draft of the bill went through several changes in order to bring reluctant Republicans on board. Republicans have a 52-48 majority in the Senate.

Random tax provisions you may have missed

Under the Tax Cuts and Jobs Act, the corporate tax rate would be permanently lowered from 35% to 20%, while future foreign profits of US-based firms would be mainly exempt from tax.

Image copyright Getty Images Image caption President Trump said the new code would be so simple that taxes could be filed on a postcard

The measures were passed despite the non-partisan Senate Joint Committee on Taxation warning on Thursday that the bill would add significantly to the federal deficit over a decade.

The committee's findings contradicted a White House claim that economic growth would compensate for the tax cuts.

Most Americans across all income levels would see modest tax breaks until 2026 and the committee said after that families earning under $75,000 a year would likely face higher taxes.

Some opponents highlighted a measure that would end a requirement introduced under Obamacare for most taxpayers to buy health insurance or face a fine. According to the non-partisan Congressional Budget Office, scrapping the mandate would push up insurance premiums and lead to 13 million people losing cover by 2027.

There were some last minute changes, including a $10,000 property tax deduction as requested by Senator Susan Collins, one of the Republicans who had been reluctant to back the bill.

How did senators react?

After the vote, Senate Democratic leader Chuck Schumer said his opponents would pay the price at the ballot box in mid-term elections next year.

"My Republican friends will ultimately pay consequences for this bill in 2018 and beyond. The Republican party will never again be the party of tax cuts for middle-class people," he warned.

He said the measures would endanger social security and medical provision.

Independent Senator Bernie Sanders was among the most vocal critics, declaring during the debate that the American treasury was "being looted".

Image copyright Getty Images Image caption Bernie Sanders said the bill would benefit the wealthiest people and largest corporations

But Republican Senate majority leader Mitch McConnell, who succeeded in bringing dissenting party members into line, said the legislation would prove to be "just what the country needs to get growing again".

He brushed aside complaints that it was pushed through without proper scrutiny, saying: "Everybody had plenty of opportunity to see the measure. You complain about process when you're losing and that's what you heard on the floor tonight."

Republican Senator Bill Cassidy also praised the bill, saying "working families and middle-income families across the nation will be better off".

Democrats were angry about the last-minute revisions, complaining that they had not been given enough time to digest the nearly 500-page document, with handwritten changes to the legislation.

The only Republican senator who refused to back the legislation was Bob Corker.

"I am not able to cast aside my fiscal concerns and vote for legislation that... could deepen the debt burden on future generations," he said.