ARTICLE AD BOX
Brandon Drenon
BBC News, Washington DC
Reporting fromCapitol Hill
Watch: First comments from Trump since his megabill passed
The US Congress has passed Donald Trump's sprawling tax and spending bill in a significant and hard-fought victory for the president and his domestic agenda.
After a gruelling session on Capitol Hill, the House of Representatives passed the bill by a vote of 218 to 214 on Thursday afternoon. It was approved in the Senate on Tuesday by one vote.
Trump had given the Republican-controlled Congress a deadline of 4 July to send him a final version of the bill to sign into law.
The Congressional Budget Office estimates the bill could add $3.3tn (£2.4tn) to federal deficits over the next 10 years and leave millions without health coverage - a forecast that the White House disputes.
Speaking to reporters on Thursday evening, Trump said the bill would "turn this country into a rocket ship".
"This is going to be a great bill for the country," he said.
He is expected to sign it into law at a ceremony on the 4 July national holiday at 17:00 EDT (22:00 BST).
A triumphant Republican Speaker Mike Johnson emerged from the House after the vote and told reporters "belief" was key to rallying support within his party.
"I believed in the people that are standing here behind me... Some of them are more fun to deal with," he said. "I mean that with the greatest level of respect."
Among those he had to convince was Representative Chip Roy, a Texas Republican who was a firm "no" just days ago when the Senate passed its version of the bill. He called the Senate version a "travesty", but changed his mind by the time voting had begun.
Watch: Moment Trump's megabill passes final vote in the US House
"I feel like we got to a good result on key things," Roy said, although the House did not make any changes to the Senate bill.
While some Republicans, like Roy, had resisted the Senate version, only two lawmakers from Trump's own party voted "nay" on Thursday: Thomas Massie and Brian Fitzpatrick.
After Johnson announced that the legislation had passed the chamber by four votes, dozens of Republican lawmakers gathered on the House floor chanting "USA! USA!"
The bill's passage on Thursday was delayed by Democratic House Minority Leader Hakeem Jeffries, who delivered the longest speech in the chamber's history.
His "magic minute" address, which is a custom that allows party leaders to speak for as long as they like, ran for eight hours and 45 minutes.
Jeffries pledged to take his "sweet time on behalf of the American people", decrying the bill's impact on poor Americans.
Watch: The moment Hakeem Jeffries ends record-breaking speech
The legislation makes savings through making cuts to food benefits and health care and rolling back tax breaks for clean energy projects.
It also delivers on two of Trump's major campaign promises - making his 2017 tax cuts permanent and lifting taxes on tips, overtime and Social Security recipients - at a cost of $4.5tn over 10 years.
About $150bn (£110bn) will be spent on border security, detention centres and immigration enforcement officers. Another $150bn is allocated for military expenditures, including the president's "gold dome" missile defence programme.
Democrats, who had used procedural manoeuvres to stall the House vote, were roundly critical of the final bill.
They portrayed it as taking health care and food subsidies away from millions of Americans while giving tax cuts to the rich.
California's Nancy Pelosi, the former speaker, said "today ushers in a dark and harrowing time", and called the bill a "dangerous checklist of extreme Republican priorities".
North Carolina's Deborah Ross said: "Shame on those who voted to hurt so many in the service of so few."
While Arizona's Yassamin Ansari said she was "feeling really sad right now", while Marc Veasey of Texas labelled the Republican Party the party of "cowards, chaos and corruption".
The fate of the so-called 'big, beautiful bill' hung in the balance for much of Wednesday as Republican rebels with concerns about the impact on national debt held firm - prompting a furious missive from Trump.
"What are the Republicans waiting for??? What are you trying to prove??? MAGA IS NOT HAPPY, AND IT'S COSTING YOU VOTES!!!," he wrote on Truth Social just after midnight local time on Thursday.
Both chambers of Congress are controlled by Trump's Republican Party, but within the party several factions were at odds over key policies in the lengthy legislation.
In the early hours of Thursday, Republican leadership grew more confident, and a procedural vote on the bill passed just after 03:00 EDT (07:00 GMT).
The final vote on the bill would come almost 12 hours later, at 14:30 EDT (19:30 GMT).