The S&P 500 rose on Monday with boosts from financial, energy and defensive sectors as investors showed some caution on the eve of US congressional elections.
While the financial sector was boosted by earnings, the energy sector, which has lagged the broader S&P 500 this year, gained 1.6 percent after the United States imposed a range of punitive sanctions on Iran.
Falling US Treasury yields helped defensive sectors such as real estate, utilities and consumer staples, which are sensitive to rising interest rates, according to traders.
"Anytime utilities and consumer staples are up that's a little fear," said Kim Forrest, senior portfolio manager at Fort Pitt Capital Group in Pittsburgh, citing the Iran sanctions as well as the Nov. 6 midterm elections.
"Regardless of your political bent you don't know what's going to happen on Tuesday that's going to affect the next few years so you're going for safety," said Forrest.
Opinion polls showed a strong chance of President Donald Trump's Republican Party holding the Senate but losing control of the House of Representatives to the Democrats - a potential hurdle to Trump's pro-business agenda, which has been a major driver of the stock market's rally since the 2016 election.
But the S&P's gain on the day could be a sign of optimism among some investors that the election "outcome will be friendly for business," according to Mark Luschini, chief investment strategist at Janney Montgomery Scott in Philadelphia.
The Dow Jones Industrial Average rose 190.87 points, or 0.76 percent, to 25,461.7, the S&P 500 gained 15.25 points, or 0.56 percent, to 2,738.31 and the Nasdaq Composite dropped 28.14 points, or 0.38 percent, to 7,328.85.
The real estate sector closed up up 1.7 percent making it the biggest percentage gainer of the S&P 500's 11 major sector indexes. Utilities rose 1.4 percent while consumer staples gained 1.2 percent.
Berkshire Hathaway rose 5 percent providing the strongest boost to the S&P's financial sector after the conglomerate run by billionaire Warren Buffett said its quarterly operating profit doubled.
A 2.8 percent drop in Apple Inc shares represented the biggest drag on Nasdaq after a Nikkei report that the company had told its smartphone assemblers to halt plans for additional production lines dedicated to the iPhone XR.
Apple posted its biggest two-day loss since January 2013, after the company's disappointing holiday-quarter forecast sent its shares down 6.6 percent on Friday.
Investors were also looking ahead to the Federal Reserve's two-day monetary policy meeting starting on Wednesday. They have been keeping a close eye on the prospects of tightening US monetary policy, especially after a string of strong economic data, including Friday's jobs report.
Advancing issues outnumbered declining ones on the NYSE by a 1.80-to-1 ratio; on Nasdaq, a 1.13-to-1 ratio favoured decliners.
The S&P 500 posted 11 new 52-week highs and one new low; the Nasdaq Composite recorded 37 new highs and 58 new lows.Volume on US exchanges was 7.07 billion shares, compared with the 8.76 billion average for the last 20 trading days.