After a frantic round of negotiations, Republicans came together in near unanimity behind the landmark legislation. The final vote was 51 to 49, with Sen. Bob Corker (R-Tenn.) the lone GOP holdout. No Democrats voted for the bill.

The measure still has to be reconciled with an earlier House-passed version before being sent to President Trump. Yet in getting the bill through the Senate, Republicans succeeded where they failed earlier this year, when their efforts to repeal the Affordable Care Act collapsed in mortifying fashion.

This time, urged on by donors and fearful of facing voters in next year’s midterm elections without a legislative achievement to show, Republicans said time and again that failure was not an option.

“The American people wanted change,” said Sen. John Barrasso (R-Wyo.). “We were able to deliver.”

Here are the major differences Republicans must resolve between their tax bills

The centerpiece of the GOP plan is a move to lower the corporate tax rate from 35 percent to 20 percent, starting in 2019. The Senate tax bill would also temporarily cut tax rates for families and individuals until 2025.

But the bill would kill a number of tax benefits. It would subject fewer people to the estate tax, a levy charged on huge inheritances, but stop short of eliminating that tax altogether.

[Winners and losers in the Senate GOP tax bill: A running list]

The most recent review of the bill by the Joint Committee on Taxation, Congress’s nonpartisan tax analysts, found that only 44 percent of taxpayers would see their burden reduced by more than $500 in 2019 but that high earners would fare much better than the poor under the bill.

And the bill makes other changes that reach far beyond the tax code itself. It repeals the individual mandate from the Affordable Care Act, a major change that was added in recent weeks as part of a broader GOP effort to dismantle the Obama-era law. The individual mandate creates penalties for many Americans who do not have health insurance, but the repeal would leave 13 million more people uninsured. It authorizes oil drilling in the Arctic National Wildlife Refuge in Alaska. And by curtailing deductions for state and local taxes, it will put pressure on some state and local spending on education, transportation and public health programs.

The tax package still must clear a couple more hurdles before it can become law. There are numerous differences between the House and Senate versions, ranging from when certain tax cuts expire to how the estate tax is handled, and though none are seen as showstoppers, complications could arise. There will be major implications for the taxes paid by families and individuals based on how those discussions go. And the negotiations over the tax bill will proceed as Congress simultaneously faces a Dec. 8 deadline for government funding to expire.

Nonetheless, GOP leaders still aim to get a final bill on Trump’s desk before Christmas.

On Friday, Sen. Ron Johnson (R-Wis.), seen talking to reporters Nov. 30, supplied one of the needed votes for the GOP’s tax bill. (Mark Wilson/Getty Images)

For Trump, a victory on the tax plan would stand as a triumph, in sharp contrast to the political troubles besetting the White House on other fronts, especially with the Senate action coming on the heels of the news that former national security adviser Michael Flynn pleaded guilty to lying to the FBI about his contacts with the Russian ambassador to the United States.

In a span of hours Friday, Senate GOP leaders secured the final few votes they needed, from Sens. Ron Johnson (R-Wis.), Jeff Flake (R-Ariz.) and Susan Collins (R-Maine).

The concessions made to get them on board forced GOP leaders to add more than $250 billion in tax cuts for individuals and businesses to their plan. To offset some of these costs, they had to abandon efforts to fully repeal the alternative minimum tax for individuals and companies, instead scaling it back.

The AMT was put in place in the 1980s as a way to prevent wealthier Americans from using tax deductions to avoid paying taxes.

Flake announced his “yes” vote after he said he had secured leadership backing for two priorities: one related to how businesses can deduct major investments such as equipment purchases and the other involving a solution for immigrants brought illegally to the United States as children.

“Having secured both of those objectives, I am pleased to announce I will vote in support of the tax reform bill,” Flake said in a statement.

Flake said his deficit concerns were allayed by a new approach to the bill’s expensing deduction, which allows businesses to write off the full cost of investments in equipment and facilities. The change calls for gradually phasing out the break after five years instead of abruptly canceling it. That adds $34 billion to the cost of the bill, but Flake said it would save money in the longer term by making lawmakers less likely to extend the break in the face of pressure from business interests.

Flake also said the administration and Senate leaders had agreed to work with him toward a resolution for immigrants brought illegally to this country as children. Known as dreamers, these immigrants were granted temporary protections under the Obama administration, which Trump has announced he will revoke in March.

Flake is a longtime proponent of reforming immigration laws and wants permanent protections for dreamers. He said that Vice President Pence had committed to working with him on the issue, though without offering a timeline or a specific solution.

Johnson came on board after leadership sweetened the deal for certain businesses whose owners pay taxes through the individual code rather than at corporate rates. Johnson retains partial ownership in one such “pass-through” business, and the issue has been a key concern.

“I appreciate the Senate leadership’s willingness to work to close the gap between pass-through businesses and C corporations,” Johnson said. The term C corporations refers to those businesses that file their taxes on the corporate side of the code.

Senate GOP leaders had proposed allowing pass-through owners to deduct 17.4 percent of their income from their taxes and then pay taxes on the remaining income. Johnson and Sen. Steve Daines (R-Mont.) argued for days that this was not generous enough for these businesses, and GOP leaders reluctantly raised the deduction level to 20 percent, which added roughly $60 billion to the size of the tax cut. But Johnson continued holding out, and on Friday he said the deduction had been raised to 23 percent, securing his support.

That meant that he and Daines were able to extract $114 billion in tax cuts for these firms in just a few days.

Collins said leadership had promised her that the bill would protect certain deductions individuals use to lower their tax bills, including on matters related to medical expenses and tax payments to state and local governments. Collins also said that leadership had agreed to support passing two bipartisan bills to help stabilize the health-insurance system set up under the Affordable Care Act.