As they scrambled to finish their sweeping tax bill in late October, House lawmakers arrived at a surprising decision: They would not cut the income tax rate for the wealthy.

That choice broke with conservative economic principles, which call for lower rates for high earners to spur investment and boost the economy. But House leaders wanted to use that money to pay for cuts elsewhere in the bill, and the White House was eager to avoid the impression that the legislation would disproportionately favor the rich — including President Trump and his top economic advisers.

Then Sen. Patrick J. Toomey went to work.

The final tax bill signed by Trump lowers the top individual rate to 37 percent from 39.6 percent, reflecting one of many triumphs for the "supply-side" economic doctrine Toomey (R-Pa.) has relentlessly promoted through more than two decades in politics over the more populist ideology of Trump's campaign.

Behind the scenes, according to aides, lobbyists and fellow lawmakers, Toomey played a major role in shaping the Republican tax overhaul — pushing not only for a cut in the top individual rate but also helping slash rates for corporations and repeal a key provision of the Affordable Care Act.

"Let's face it, he was central," said Sen. Bob Corker (R-Tenn.), who negotiated a crucial budget agreement with Toomey that paved the way for the tax bill. "This would be, I'm sure, the ultimate thing for him to accomplish here in the United States Senate, and so he stayed focused."

More broadly, Toomey's influence represents the imprint of the supply-side doctrine on the bill — the notion that the benefit of lower taxes and fewer regulations on businesses and investors, in the words of its critics, "trickle down" to other Americans. That thinking delivered most of the dollar value of the GOP tax cuts to a lower corporate rate and a new break for owners of "pass-through" businesses, whose profits are taxed as individual income, while offering relatively meager benefits for wage-earning Americans.

"But for Pat Toomey, it's not likely we would have seen 50-plus votes in the Senate for that nature of a tax cut," said David M. McIntosh, president of the Club for Growth, a group that promotes tax cuts and that Toomey led before entering the Senate.

[How Republicans pulled off the biggest tax overhaul in 30 years]

The tension between populism and conservative orthodoxy is set to play out next year as the Trump administration and congressional Republicans embark on a legislative agenda that could include major infrastructure and trade initiatives. While Trump proposes hundreds of billions of dollars in spending and deploying protectionist measures for American companies, Toomey and his allies lean toward encouraging private infrastructure investment and removing trade barriers.

If the tax bill is any indication, shrewd conservatives such as Toomey could find a way to again turn the president's agenda toward their liking.

Toomey called the tax legislation the capstone of a political career that began when he was a local politician who wrote an anti-tax measure into the city charter and included a stint as a House member who fought new banking regulations before he became the leader of an influential policy group that pushed to elect supply-side thinkers to Congress.

"I've spent my entire career hoping for this day," he said in an interview last week. "To have a chance to be able to make a constructive series of contributions, it's been very gratifying and fulfilling."

A little more than a year ago, there were serious doubts that Toomey would find himself in a position to guide a once-in-a-generation tax rewrite. In the fall of 2016, not only was Democrat Hillary Clinton expected to win the presidency — dashing any hopes of a conservative tax overhaul — but Toomey's political future was in serious doubt.

Most polls taken in the final weeks of his reelection campaign had Toomey narrowly trailing Democrat Katie McGinty after a campaign in which he had emphasized his efforts to support law enforcement and work with Democrats on gun control, not his sharp economic policy views.

It was the most expensive Senate race in history, involving $179 million in combined spending, and Toomey pulled out a two-point win with the help of $3.6 million from the Club for Growth's super PAC, $9.7 million from groups in the Koch brothers' network and $6.1 million from the U.S. Chamber of Commerce — all deeply interested in major tax cuts.

Just as important, Trump won the presidency as Republicans held on to the House and Senate, setting the stage for the kind of tax overhaul that GOP lawmakers and donors had dreamed about for decades.

But it also set up an intraparty battle of ideologies, between the ideas espoused by top Trump advisers such as former chief strategist Stephen K. Bannon and the conservative policy views held by supply-siders such as Toomey.

"It required pushback to the Bannon wing of the party to say: 'No, we're not a populist, stick-it-to-the-rich party,' " McIntosh said. "We're for tax cuts for everyone, and that includes successful people who invest money and create the jobs you're trying to create."

Toomey, with seats on the Senate Budget and Finance committees, would be in the thick of the action. He was tapped by Finance Committee Chairman Orrin G. Hatch (R-Utah) as one of the "core four" panel members deputized to craft the legislation.

As Republicans started getting serious about writing far-reaching tax legislation last summer, Toomey began handing his colleagues a sheet of paper depicting a pair of scales.

On one side was a list of all the tax cuts the GOP was hoping to enact into law, starting with a drastic slash in the 35 percent corporate rate. On the other side was a list of the potential ways they could offset the revenue loss.

For months, top Republican leaders had been promising a ­"revenue-neutral" tax bill — one that, broadly speaking, would pay for the rate cuts by closing loopholes and eliminating certain deductions. But the scales of Toomey's handout tilted sharply toward the cuts. The gap added up to more than $2 trillion over a decade.

Toomey's message was simple: Revenue-neutral tax restructuring was not going to work.

His lobbying paid off. Shortly after Labor Day, Republican members of the Senate Budget Committee met inside the offices of Senate Majority Leader Mitch McConnell (R-Ky.) and concluded that they could support a tax bill that would add to the deficit.

But how much was up for debate. McConnell tapped Toomey and Corker, a budget hawk, to work it out.

Toomey wanted a $2.5 trillion budget for the tax bill — enough to squeeze in a laundry list of tax cuts aimed at generating growth. Corker was willing to offer budgetary "headroom" to craft an ambitious bill but was afraid the tax writers would avoid eliminating loopholes if given too much leeway. They settled on $1.5 trillion.

"That was the fulcrum, really, for everything we've done since," Senate Majority Whip John Cornyn (R-Tex.) said of the budget agreement.

As the Senate tax bill took shape in the weeks leading up to Thanksgiving, Toomey asserted himself inside the Finance Committee on two crucial issues. The first was whether the bill would bring down the top individual tax rate: Where the House stood pat at 39.6 percent and created a quirk where some earnings of wealthy taxpayers would be subject to an even higher marginal rate, Toomey demanded a cut.

"You can argue it wasn't terribly substantial — we only got down to 38.5" in the Senate bill, Toomey said. "But for me, it was important directionally and important to get Republicans to agree that it is actually okay to cut everyone's taxes."

The other was the repeal of the Affordable Care Act's individual mandate, which had been treated as political kryptonite by Republican leaders. Thanks to Sen. Tom Cotton (R-Ark.) attacking this part of President Barack Obama's signature health-care law — the most crucial but least-popular provision of the ACA — the idea of getting rid of it gradually gained traction. Toomey forcefully made the case inside the Finance Committee: Not only would it allow Republicans to partially deliver on their promises to repeal "Obamacare," it would generate revenue that would solve majorbudgetary issues that the tax writers had encountered.

The members agreed, and Hatch added the mandate's repeal to the bill on Nov. 15. But there was a catch: Eliminating the mandate meant that less in federal insurance subsidies would be paid to low-income Americans. The Joint Committee on Taxation, the official congressional revenue scorekeeper, issued an analysis combining the lost subsidies with tax cuts, implying that low-income Americans would be subject to drastic tax increases. Democrats seized on the data, calling it evidence of the GOP's cruelty. Republican aides prepared to roll back the decision.

The next morning, inside a breakfast meeting of Finance Committee Republicans, Toomey urged his colleagues not to waver: Repealing the mandate was the right policy, he said, and they should not be cowed.

Soon after the markup gaveled to order that day, Hatch called on Toomey to make his case.

"This is absolutely not a tax increase, and you guys know that," he bellowed at Democrats. "It is not a tax increase if a person decides they don't want to buy an Obamacare plan and, as a result, we don't send a payment to an insurance company."

Toomey was dealt one very public setback: As the Senate bill headed toward final passage, Democrats seized on a provision Toomey had inserted into the bill: language exempting Hillsdale College, a school with prominent conservative backers, from a new tax on college endowments. Four Republicans joined Democrats to strip the measure from the bill in the early hours of Dec. 2.

The sting didn't last long.

Eighteen minutes later, the Senate voted to pass the $1.5 trillion bill — with a 20 percent corporate rate, a lower top individual rate and the repeal of the individual mandate intact.

Read more at PowerPost