WASHINGTON (Reuters) - When Republicans tried to repeal and replace Obamacare over the summer, they acted like “a bunch of free range chickens”, said Republican Senator John Kennedy. “Everybody was upset, tired, mad, people drawing lines in the dirt.”

U.S. President Donald Trump listens to remarks by Senate Majority Leader Mitch McConnell (R-KY) (L) after meeting with him and House Speaker Paul Ryan (R-WI) (R) at the White House in Washington, U.S. November 28, 2017. REUTERS/Jonathan Ernst

Not this time. Republican leader Mitch McConnell and the rest of his party’s Senate leadership brought party members into line this week and finally won passage of a sweeping tax overhaul early on Saturday.

Late arm-twisting and deal-sweeteners for wavering lawmakers allowed them to push through legislation that aims to slash corporate taxes and cut personal taxes.

Democrats complained it was a bad deal for middle-class and poor Americans and would irresponsibly raise the national debt by $1.4 trillion over the next decade. But they were outnumbered and Republicans’ discipline, in short supply for much of this year, saw the bill through.

The debate revealed how the Republican Party is undergoing a transformation under President Donald Trump. Republicans who fight above all for a balanced budget no longer wield the power they once had.

“I feel somewhat like a dinosaur,” deficit hawk Bob Corker admitted on Friday afternoon. Hours later, he was the only Republican to vote against the bill.

Fear also played a role. The risk of a backlash from wealthy donors and conservative supporters if the party failed to deliver on another campaign promise ahead of mid-term elections next year helped party leaders get the legislation approved in a 51-49 vote.

“I think after failing twice on healthcare, folks went back home and talked to the real people of America,” said Kennedy. “And they were told, ‘Look, we sent you up there to fix our problems. Fix them or we’ll find somebody who will.’”

McConnell needed 50 of the 52 Republicans in the Senate to back the tax bill, knowing Vice President Mike Pence was on hand to provide the tie-breaking vote if needed.

McConnell could only count on 43 votes on Wednesday night. Nine other Republican members were wobbly and he had no support from Senate Democrats.

McConnell and his allies went to work, offering a wide range of late concessions to holdouts to get a political victory after months of frustration.

The bill still needs to be reconciled with a different version approved by the House of Representatives, but the Senate bill is expected to remain largely intact.

Led by Corker and Jeff Flake, a small group of fiscal conservatives were at first upset that the Senate bill was going to increase fiscal deficits and the national debt. Early efforts to get their support went slowly.

“It’s been pretty hard to make them happy so far. We’re going to keep working on it, as we always have, and we’ll get to the finish line,” Senator Orrin Hatch said on Thursday night.

Flake came around when he was able to win two concessions. First, he got a commitment from Senate leadership and the Trump administration to put a time limit on allowing companies to write off the full value of new capital investments.

Second, Pence assured Flake the administration would work with him on fair and permanent protections for illegal immigrants who came to the United States as children.

Two other fiscal conservatives, James Lankford and Jerry Moran, also came on board. Although Corker refused to yield, the others’ votes were enough to ensure victory.

LEVERAGE

Senator Ron Johnson demanded and won amendments to further ease the tax burden on “pass-through” businesses. “I was just kind of biding my time ... And then Senator Portman came over and said ‘What can we do’?”, Johnson said of a Thursday night vote.

Even moderate Senator Susan Collins, who helped scuttle Obamacare repeal efforts earlier this year, agreed to vote in favor of the tax bill.

Representing voters with a high state tax burden in Maine, Collins was against her party’s plan to end the deduction of state and local property taxes. Under an amendment she pushed, taxpayers would be allowed to deduct up to $10,000 a year.

Collins also said she was assured by Republican leaders that they would take steps soon to mitigate damage caused by the repeal of a fee linked to the Obamacare “individual mandate”, which requires some Americans to buy health insurance.

McConnell also got lucky in that Trump didn’t make his job any harder. Unlike his conduct in the Obamacare debate, Trump largely stayed on message, proclaiming the tax bill would help the middle class and businesses. Although incorrect, he also claimed it would be the biggest tax cut ever.

Trump met with Republican senators on Capitol Hill for lunch this week, a gathering described as thoughtful and positive.

“Nobody called anybody names or talked about anybody’s native American heritage, or anything,” said Kennedy, referring to Trump’s habit of picking fights with perceived enemies.

Democrats were furious, saying Republicans were throwing money at the rich and that the bill was handled too fast.

“If the economy grows or shrinks. If it creates jobs or loses them. Who knows? Certainly no one here. No one could know, because it hasn’t even been read, let alone thoughtfully considered,” said Senate Democratic leader Chuck Shumer.