US President Donald Trump's tax cut and spending package has cleared its final hurdle in Congress as the Republican-controlled House of Representatives narrowly approved the bill and sent it to him to sign into law.
The 218-214 vote amounts to a significant victory for the president that will fund his immigration crackdown, make his 2017 tax cuts permanent and deliver new tax breaks that he promised during his re-election campaign.
It also cuts health and food safety net programmes and ends dozens of green energy incentives.
The White House said that President Trump will sign the bill on Friday.
The legislation will add $3.4 trillion (€2.9 trillion) to the country's $36.2 trillion debt (€31 trillion), according to the non-partisan Congressional Budget Office (CBO).
Despite concerns over the 869-page bill's price tag and its impact on healthcare programmes, Republicans largely lined up in support, with just two of the party's 220 house members voting against it.
It had already cleared the Republican-controlled Senate by the narrowest possible margin.
Republicans said the legislation will lower taxes for Americans across the income spectrum and spur economic growth.
Party Representative Virginia Foxx of North Carolina described the bill as bringing "historic tax relief for working families. Massive investment to secure our nation's borders. Capturing generational savings. Slashing waste, fraud and abuse in government programs so that they may run more efficiently".

Every Democrat in Congress voted against the bill, describing it as a giveaway to the wealthy that would leave millions uninsured.
"The focus of this bill, the justification for all of the cuts that will hurt everyday Americans, is to provide massive tax breaks for billionaires," Democratic Leader Hakeem Jeffries said in an eight-hour, 46-minute speech that was the longest in the House of Representative's history.
President Trump kept up the pressure throughout, cajoling and threatening politicians as he pressed them to send him the legislation by tomorrow, the Independence Day holiday.
"FOR REPUBLICANS, THIS SHOULD BE AN EASY YES VOTE. RIDICULOUS!!!" he wrote on social media.
Republicans raced to meet the deadline, working through last weekend and holding all-night debates in the house and the senate.
The bill was passed by the senate on Tuesday in 51-50 vote. Vice President JD Vance cast the deciding ballot.
According to the CBO, the bill would lower tax revenues by $4.5 trillion (€38 trillion) over ten years and cut spending by $1.1 trillion (€936bn).
We need your consent to load this rte-player contentWe use rte-player to manage extra content that can set cookies on your device and collect data about your activity. Please review their details and accept them to load the content.Manage Preferences
Medicaid accounts for bulk of spending cuts
The spending reductions largely come from Medicaid, the health programme that covers 71 million low-income Americans.
The bill would tighten enrollment standards, institute a work requirement and clamp down on a funding mechanism used by states to boost federal payments - changes that would leave nearly 12 million people uninsured, according to the CBO.
Republicans added $50 billion (€59bn) for rural health providers to address concerns that the cutbacks would force them out of business.
Non-partisan analysts found that the wealthiest Americans would see the biggest benefits from the bill, while the low paid would effectively see their incomes drop as the safety-net reductions would outweigh their tax cuts.
The increased debt load created by the bill would also effectively transfer money from younger to older generations, analysts said.
Ratings firm Moody's downgraded US debt in May, citing the mounting debt, and some foreign investors said the bill is making US Treasury bonds less attractive.
On the other side of the ledger, it staves off tax increases that were due to hit most Americans at the end of this year, when President Trump's 2017 individual and business tax cuts were due to expire.
Those reductions are now made permanent while tax breaks for parents and businesses are expanded.
The bill also sets up new tax breaks for tipped income, overtime pay, seniors and auto loans, fulfilling Mr Trump's campaign promises.
The final version of the legislation includes more substantial tax cuts and more aggressive healthcare cuts than an initial version that passed the House of Representatives in May.
During deliberations in the Senate, Republicans also dropped a provision that would have banned state-level regulations on artificial intelligence and a "retaliatory tax" on foreign investment that had spurred alarm on Wall Street.