Wall Street ended higher on Tuesday during voting in midterm elections that will determine control of the U.S. Congress, with investors betting on a political stalemate that could prevent major policy changes.

It was the third straight day of gains on the U.S. stock market, leaving the Dow Jones Industrial Average down less than 10% year-to-date.

Helping the blue-chip Dow, shares of drugmaker Amgen Inc rallied almost 6% to a record high after the company reported positive data related to its cholesterol drug and obesity treatment.

All 435 House of Representative seats and some 35 seats in the Senate are on the ballot, with experts saying there may be days of waiting before it is clear who won certain races. Nonpartisan forecasts and opinion polls suggested a strong chance of Republicans winning a House majority and a tight race for Senate control.

"On balance, financial markets like gridlock. To the extent that change will be slow and evolving, a divided government of course provides that backdrop," said Terry Sandven, chief equity strategist at U.S. Bank Wealth Management in Minneapolis.

A surprise victory for Democrats, however, could raise concerns about tech-sector regulation as well as budget spending that could add to already-high inflation, according to market strategists.

Investors are also awaiting a key inflation reading due on Thursday, which is expected to show easing in consumer prices and provide further clues on whether the U.S. Federal Reserve could soften its campaign of aggressive interest rate hikes.

Traders are divided about whether the Fed will raise rates by 50 basis points or 75 basis points at the central bank's meeting in December, according to CME Fedwatch tool.

Cryptocurrency-related stocks including Coinbase Global and Microstrategy tumbled after Crypto giant Binance signed a nonbinding agreement to buy rival FTX's non-U.S. unit to help cover a "liquidity crunch" at the cryptocurrency exchange.

"Some investors will shoot first and ask questions later, but the good thing is crypto is kind of isolated. They are on their own, they really are not part of the equity market," said Joe Saluzzi, co-manager of trading at Themis Trading in Chatham, New Jersey.

The S&P 500 is up about 7% from its October closing low, but it remains down about 20% in 2022 due to worries that the Fed's aggressive rate hikes could cripple the U.S. economy.

The S&P 500 climbed 0.56% to end the session at 3,828.13 points.

The Nasdaq gained 0.49% to 10,616.20 points, while the Dow Jones Industrial Average rose 1.02% to 33,160.83 points.

Of the 11 S&P 500 sector indexes, 10 rose, led by materials , up 1.72%, followed by a 0.92% gain in information technology.

Take-Two Interactive Software Inc slumped almost 14% after the videogame publisher lowered its annual sales outlook, while ride-hailing firm Lyft Inc tumbled 23% after forecasting current-quarter revenue below Wall Street estimates.

Advancing issues outnumbered falling ones within the S&P 500 by a 2.5-to-one ratio.

The S&P 500 posted 21 new highs and 9 new lows; the Nasdaq recorded 97 new highs and 258 new lows.

Volume on U.S. exchanges was relatively light, with 11.7 billion shares traded, compared with an average of 11.8 billion shares over the previous 20 sessions.

(Reporting by Noel Randewich in Oakland, Calif., and David Carnevali in New York Additional reporting by Amruta Khandekar, Sruthi Shankar, Devik Jain and Shubham Batra in Bengaluru Editing by Maju Samuel and Matthew Lewis)