After late-night wrangling and last-minute changes to win over several holdouts, Senate Republicans expressed confidence Friday that they have secured enough support to pass their overhaul of the tax code.

“We have the votes,” Majority Leader Mitch McConnell said as he departed a meeting of the entire Senate GOP conference on Friday. Republicans are still rewriting the legislation to accommodate the changes, but are likely to vote on final passage sometime before the end of the day.

As of Friday afternoon, 50 senators -- all Republicans – were in support of the bill, enough to pass it without any Democratic backing and with Vice President Mike Pence casting a tie-breaker. Sens. Susan Collins of Maine and Bob Corker of Tennessee remained uncommitted, though Collins won a key concession in the legislation and expressed confidence in the direction of negotiations. Corker, who had been fighting for changes to prevent the measure from adding significantly to the deficit, did not get any concessions and did not say how he would vote.

If Republicans are successful Friday, it will mark a critical -- though not final -- step toward putting the tax overhaul on President Trump’s desk, thus securing the first major legislative victory of his presidency just before his first year in office concludes.

The main tenets of the Senate legislation remained unchanged -- slashing the corporate rate to 20 percent from 35 percent; providing tax cuts for pass-through businesses; lowering individual tax rates and doubling the standard deduction; and repealing the Affordable Care Act individual mandate.

The momentum for Republicans shifted early Friday morning when Sens. Ron Johnson of Wisconsin and Steve Daines of Montana, two of the last holdouts, both announced their support. Johnson and Daines had been fighting for deeper tax cuts for so-called pass-through businesses -- those that pay income taxes through the individual system, rather than at the corporate rate. The Senate bill originally gave pass-throughs a 17.4 percent deduction on their taxes, but Johnson and Daines pushed that to 23 percent in the latest version -- changes paid for with a higher rate for business repatriation.

Johnson, who had complained about being sidelined in the discussions, also secured a promise from leadership that he would be kept involved in any conference committee negotiations with the House on the pass-through provision, he told reporters.

The last, and perhaps most significant, holdout won over by GOP leadership was Arizona Sen. Jeff Flake, who has publicly sparred with Trump and will not seek re-election next year. Flake announced his support Friday, likely representing the 50th vote needed for passage.

Flake said he had earned two key objectives: killing a “gimmick” for business expensing, and securing a commitment from the administration and leadership on a legislative solution for DACA, the executive order giving protected status to immigrants who arrived illegally as children, which Trump has said he would revoke in March.

A spokesman for the Arizona senator cited a promise from Vice President Pence and the White House that he would be “in the middle of the forthcoming legislative process to get a fix to the DACA situation. As with any legislative process, the details and timing will unfold.”

Sen. John Cornyn, the Republican whip, said the commitment to Flake was not on any specific policy for the childhood arrivals or timing for a solution, but rather a commitment that he would be part of negotiations for a legislative fix. Flake’s office did not respond to questions about the details of that agreement.

“He’s going to have a seat at the table if he wants it, but he’s, I think, telling the world that this is one of his priorities,” Cornyn said.

Collins’ support remains in flux, though she secured a significant change to the bill and expressed optimism about the direction of the legislation. The Senate bill had fully repealed the state and local tax deduction, but the Maine lawmaker secured a partial re-instatement of the property tax deduction up to $10,000, identical to a key provision in the House’s version of the measure.

If Senate Republicans pass their legislation Friday, the House is expected to vote Monday afternoon to send the bill to a formal conference. That process is unlikely to take long, as Republicans in both chambers hope to put a final version on the president’s desk before the end of this year. It’s unclear how much of the bills may change during conference negotiations.

Democrats, who have roundly criticized both the process and policy of the GOP tax plan, were frustrated by the speed with which it was changed Friday. Sen. Joe Manchin of West Virginia said he had been eager to work with Republicans and support tax reform, but said GOP senators had shut Democrats out of the process and did not want it to be a bipartisan effort. He expressed significant frustration with not having seen the final version of the bill only hours before voting on it.

“I’d still like to find something that I could vote for and I haven’t been able to see anything. That’s a shame, that really is a shame,” Manchin said. “I guess they’re just determined to make this strictly a party-line vote. I’ve never seen anybody work so hard than the leadership on the Senate side to make this a partisan issue.”