NEW YORK (Reuters) - The S&P closed at a record high and the Dow Jones Industrial Average broke above the 24,000 mark for the first time on Thursday as investors gained confidence that the Republican party’s push for a U.S. tax overhaul would succeed.

Republican Senator John McCain’s decision to back the tax bill provided a new jolt of momentum for the legislation. McCain had helped defeat Republicans’ efforts to repeal Obamacare, and 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.”

“We have seen ‘no’ votes flipping to the ‘yes’ column, so that makes the passage of the bill more certain but also moves it up on the calendar,” said Bucky Hellwig, senior vice president at BB&T Wealth Management in Birmingham, Alabama. “The rush is on right now to get that cranked out, and investors are saying we’re ready to buy into that.”

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

The blue-chip Dow index 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 Dow Jones Industrial Average .DJI rose 331.67 points, or 1.39 percent, to 24,272.35, the S&P 500 .SPX gained 21.51 points, or 0.82 percent, to 2,647.58, and the Nasdaq Composite .IXIC added 49.63 points, or 0.73 percent, to 6,873.97.

Trading volume was unusually high.

Slideshow ( 7 images )

The Russell 2000 .RUT, of smaller companies, closed up 0.12 percent, 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.

“We haven’t seen a sustained rally in small caps, and we still don’t know the details” of the tax bill, Hellwig said. “But it’s moved forward, which is significant in terms of the planning for 2018.”

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

A reduction in the corporate tax rate to 25 percent could boost S&P 500 earnings by 6.5 percent, UBS U.S. equity strategist Keith Parker estimated.

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 biggest one-day drop in more than three months as investors sold technology stocks. However, the S&P technology sector .SPLRCT erased some of its losses on Thursday to end up almost 1 percent.

Slideshow ( 7 images )

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

Industrials .SPLRCI rose 1.53 percent, helped by an almost 2 percent jump in transportation stocks .DJT, which would get a big boost from corporate tax cuts.

The S&P Financials sector .SPSY 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.

About 9 billion shares changed hands on U.S. exchanges in the busiest trading day since June 23. This compares with the 6.56 billion average for the last 20 sessions.

Advancing issues outnumbered declining ones on the NYSE by a 1.41-to-1 ratio; on Nasdaq, a 1.13-to-1 ratio favored advancers.

The S&P 500 posted 119 new 52-week highs and no new lows; the Nasdaq Composite recorded 184 new highs and 23 new lows.