WASHINGTON (AP) — Republicans used a burst of eleventh-hour horse-trading Friday to edge a $1.4 trillion tax bill to the brink of Senate passage, as a party starved all year for a major legislative triumph took a giant step toward giving President Donald Trump one of his top priorities by Christmas.

"We have the votes," Senate Majority Leader Mitch McConnell, R-Ky., declared after leaders swayed holdout senators by agreeing to fatten tax breaks for millions of businesses and let people deduct local property taxes.

Party leaders hoped for Senate approval later Friday on a measure that focuses the bulk of its tax reductions on businesses and higher-earning individuals, gives more modest breaks to others and would be the boldest rewrite of the nation's tax system since 1986. Debate stretched into the evening as lawmakers waited for Republicans to unveil the final version of their measure.

Republicans touted the package as one that would benefit people of all incomes and ignite the economy. Even an official projection of a $1 trillion, 10-year flood of deeper budget deficits couldn't dissuade nearly all GOP senators from rallying behind the bill.

"Obviously I'm kind of a dinosaur on the fiscal issues," said Sen. Bob Corker, R-Tenn., the only announced GOP opponent, who battled to keep the measure from worsening the government's accumulated $20 trillion in IOUs.

The Republican-led House approved a similar bill last month in what has been a stunningly swift trip through Congress for legislation that impacts the breadth of American society and is hundreds of pages long.

After spending the year's first nine months futilely trying to repeal President Barack Obama's health care law, GOP leaders were determined to move the measure rapidly before opposition Democrats and lobbying groups could blow it up. The party views passage as crucial to retaining its House and Senate majorities in next year's elections.

Democrats derided the bill as a GOP gift to its wealthy and business backers at the expense of lower-earning people. They contrasted the bill's permanent reduction in corporate income tax rates from 35 percent to 20 percent to individual tax breaks that would end in 2026.

Congress' nonpartisan Joint Committee on Taxation has said the bill's reductions for many families would be modest and said by 2027, families earning under $75,000 would on average face higher, not lower, taxes.

"Every time the choice is between corporations and families, the Republicans choose corporations," said Senate Minority Leader Chuck Schumer, D-N.Y.

Democrats took to the Senate floor and social media to mock what they said was a 479-page, amended version of the bill that included changes in barely legible handwriting. They also criticized Sen. Patrick Toomey, R-Pa., for a proposed amendment they said would give a tax break to only conservative Hillsdale College in Michigan. Toomey, one of the chamber's more conservative members, acknowledged the language would help Hillsdale but said other schools might benefit, too.

The bill hit rough waters Thursday after the Joint Taxation panel concluded it would worsen federal shortfalls by $1 trillion over a decade, even when factoring in economic growth that lower taxes would stimulate.

Trump administration officials and many Republicans have insisted the bill would pay for itself by stimulating the economy. But the sour projections stiffened resistance from some deficit-averse Republicans.

But after bargaining that stretched into Friday morning, McConnell and other leaders said victory was assured in a chamber they control 52-48. Facing unyielding Democratic opposition, Republicans could lose no more than two GOP senators and prevail with a tie-breaking vote from Vice President Mike Pence.

Under the changes leaders agreed to, millions of companies whose owners pay individual, not corporate, taxes on their profits would be allowed deductions of 23 percent, up from 17.4 percent. That helped win over GOP Sens. Ron Johnson of Wisconsin and Steve Daines of Montana.

People would be allowed to deduct up to $10,000 in property taxes, a demand of Sen. Susan Collins of Maine. That matched a House provision that chamber's leaders included to keep some GOP votes from high-tax states like New York, New Jersey and California.

Collins, a moderate and frequent maverick who opposed her party's Obamacare repeal drive, said she'd back the tax bill.

The changes added more than $300 billion to the tax bill's costs. To pay for that, leaders agreed to reduce the number of high-earners who must pay the alternative minimum tax, rather than completely erasing it.

They'd also increase a one-time tax on profits U.S.-based corporations are holding overseas and require firms to keep paying the business version of the alternative minimum tax.

Sen. Jeff Flake, R-Ariz. — who, like Corker, had been a holdout and has sharply attacked Trump's capabilities as president — said he'd back the bill. He said he'd received commitments from party leaders and the administration "to work with me" to restore protections, dismantled by Trump, for young immigrants who arrived in the U.S. illegally as children. That seemed short of a pledge to actually revive the safeguards.

Overall, the Senate bill would drop the highest personal income tax rate from 39.6 percent to 38.5 percent. The estate tax levied on a few thousand of the nation's largest inheritances would be narrowed to affect even fewer.

Deductions for state and local income taxes, moving expenses and other items would vanish, the standard deduction — used by most Americans — would nearly double to $12,000 for individuals and $24,000 for couples, and the per-child tax credit would grow.

The bill would abolish the "Obamacare" requirement that most people buy health coverage or face tax penalties. Industry experts say that would weaken the law by easing pressure on healthier people to buy coverage, and the nonpartisan Congressional Budget Office has said the move would push premiums higher and leave 13 million additional people uninsured.

It would also explicitly let parents buy tax-advantaged 529 college savings accounts for fetuses, a step they can already take but which anti-abortion forces hailed as a victory by inscribing that right into law.