The S&P 500 index closed at a record high and the Dow Jones Industrial Average broke above the 24,000 level for the first time on Thursday as investors gained confidence that the Republican party’s push for a tax overhaul would succeed.

Republican Senator John McCain’s decision to back the tax bill provided a new jolt of momentum for the legislation. A “yes” vote by him on the tax measure was considered crucial. He said the tax bill would boost the economy, although it is “far from perfect.”

The Senate was due to begin voting on amendments to the bill late Thursday, with a final vote late in the evening or early Friday.

The Dow has crossed four 1,000-point milestones this year on the back of strong corporate earnings, robust economic data and hopes for corporate tax cuts. The tax bill would cut the corporate tax rate to 20 percent from 35 percent.

The Russell 2000, of smaller companies, closed with a 0.12 percent gain, hitting its third record close in a row. However, it lagged the large cap index gains, suggesting that expectations for tax cuts were not fully priced in.

The market has priced in only a 20 percent to 40 percent probability of tax cuts, according to several Wall Street strategists.

The S&P and the Dow have registered eight straight months of gains, while the Nasdaq has posted five consecutive months of increases.

On Wednesday, the Nasdaq posted its largest one-day drop in more than three months as investors sold technology stocks. However, the S&P technology sector erased some of its losses on Thursday to end up almost 1 percent.

The S&P energy index was the strongest sector, rising 1.55 percent after OPEC agreed to extend oil production cuts to the end of 2018.

The industrials sector index rose 1.53 percent, due to an almost 2 percent increase in transportation stocks, which would receive a large boost from corporate tax cuts.

The S&P Financials sector pared earlier gains to end up 0.6 percent, boosted by expectations that bank tax cuts would be passed on to investors in the form of share buybacks.

Data that pointed to a sustained increase in underlying price pressures and a drop in first-time applications for unemployment benefits last week also helped sentiment.

Trading volume was unusually high. Approximately 9 billion shares changed hands on major domestic equity exchanges in the busiest trading day since June 23. This compares with the 6.56 billion share daily average for the past 20 trading sessions.