NEW YORK (Reuters) - U.S. stocks ended lower in a choppy trading session on Monday, dragged down by technology stocks amid lingering worries over interest rates and corporate earnings.

The benchmark S&P 500 index teetered between positive and negative territory for much of the day but moved definitively lower in the last half-hour of trading. The Dow, which was positive for most of the session, reversed course.

The technology index .SPLRCT fell 1.6 percent, weighing the most on the S&P 500, while defensive sectors such as real estate .SPLRCR, consumer staples .SPLRCS and utilities .SPLRCU led the S&P's major sectors in percentage gains.

The major stock indexes sold off sharply last week, which led to their sharpest weekly percentage declines in seven months. Investor concerns have mounted about the impact on corporate profits of tariffs and rising borrowing costs as the third-quarter earnings season kicks into high gear this week.

S&P 500 companies on average are expected to report 21.6 percent year-over-year profit growth, a decrease from the previous two quarters, according to I/B/E/S data from Refinitiv.

Also, the Treasury Department released data on Monday showing that the U.S. federal government closed the 2018 fiscal year with the biggest deficit since 2012. It ended the 12 months through September $779 billion in the red as tax cuts hit revenues and the government paid more to service a growing national debt.

Yields on the benchmark 10-year Treasury note were at 3.1557 percent, holding above September’s levels but below the levels that prompted last week’s sell-off.

Slideshow ( 2 images )

“The market is in wait-and-see mode,” said Keith Lerner, chief market strategist at SunTrust Advisory Services in Atlanta. “It’s waiting for earnings, waiting for the Fed, and waiting for economic data from China to see if things are stabilizing.”

The Dow Jones Industrial Average .DJI fell 89.44 points, or 0.35 percent, to 25,250.55, the S&P 500 .SPX lost 16.34 points, or 0.59 percent, to 2,750.79, and the Nasdaq Composite .IXIC dropped 66.15 points, or 0.88 percent, to 7,430.74.

Bank of America Corp BAC.N shares dropped 1.9 percent after loan growth at the second-largest U.S. bank lagged rivals and fees from advising on deals and underwriting bonds fell in the third quarter.

Apple Inc AAPL.O shares fell 2.1 percent and weighed the most on all three of Wall Street's major indexes after Goldman Sachs said there were multiple signs of rapidly slowing consumer demand in China, which could affect demand for iPhones this fall.

The top gainers on the S&P were L3 Technologies Inc LLL.N, which jumped 12.8 percent, and Harris Corp HRS.N, which climbed 11.9 percent, after the military communication equipment providers announced an all-stock merger to create the sixth-largest U.S. defense contractor.

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

The S&P 500 posted two new 52-week highs and seven new lows; the Nasdaq Composite recorded 14 new highs and 145 new lows.

Volume on U.S. exchanges was 6.91 billion shares, compared to the 7.82 billion average over the last 20 trading days.