NEW YORK — U.S. stocks ended a choppy session slightly higher on Monday as gains in energy shares offset losses in financials ahead of quarterly corporate earnings later this week.

Geopolitical tensions added to the choppiness. U.S. Secretary of State Rex Tillerson said on Sunday the military strikes against Syria over its alleged use of chemical weapons were a warning to other nations, including North Korea, that “a response is likely” if they pose a danger.

With trading slow at the beginning of a holiday-shortened week, volume was the lightest of the year so far.

The S&P energy index, up 0.8 percent, was the day’s best-performing S&P 500 sector, following gains in oil prices.

Investors prepared for the start of quarterly profit reports, with earnings of S&P 500 companies estimated to have risen 10.1 percent in the first three months of the year.

Energy companies, which dragged down results during the recent U.S. earnings recession, are expected to do most of the heavy lifting this profit period with a whopping 600 percent year-over-year increase.

“I think the key will be oil stocks given how volatile oil has been since the election,” said Jake Dollarhide, chief executive officer of Longbow Asset Management in Tulsa, Oklahoma, which has about $50 million in assets under management.

The energy index is down 6 percent for the year to date.

The Dow Jones Industrial Average was up 1.92 points, or 0.01 percent, to 20,658.02, the S&P 500 gained 1.62 points, or 0.07 percent, to 2,357.16 and the Nasdaq Composite added 3.11 points, or 0.05 percent, to 5,880.93.

Thursday will be the last trading day of the week on Wall Street ahead of the Good Friday holiday.

JPMorgan, Citigroup and Wells Fargo are scheduled to report earnings on Thursday and could throw some light on the U.S. banking industry’s performance amid a rally in financial shares since the election of President Donald Trump.

Bank stocks have retreated of late as investors question lofty valuations and Trump’s ability to swiftly introduce simpler regulations and other policies following the failure of a healthcare reform bill.

The S&P 500 financial sector was off 0.3 percent.

Traders attributed a stock dip around noon to unverified rumors stemming from weekend news related to North Korea.

“You’ve had a lot of geopolitical news that could have driven this market a lot lower, and I think it’s a huge relief that the market has held up so well,” Dollarhide said.

Whole Foods Market was the S&P 500’s biggest percentage gainer on the day, rising 10 percent after activist investor Jana Partners LLC disclosed an 8.3 percent stake in the company as it looks to shake up the company’s board.

Straight Path Communications surged 151 percent to $91.64 after AT&T offered a huge premium to buy the owner of wireless spectrum licenses.

Swift Transportation jumped 23.7 percent to $24.77 after agreeing to a merger with fellow trucking company Knight Transportation. Knight’s shares were up 13.4 percent.

Advancing issues outnumbered declining ones on the NYSE by a 2.09-to-1 ratio; on Nasdaq, a 1.06-to-1 ratio favored decliners.

The S&P 500 posted 8 new 52-week highs and 3 new lows; the Nasdaq Composite recorded 68 new highs and 38 new lows.