(AP) -- A choppy day of trading on Wall Street ended Tuesday with stocks closing lower after a technology sector-led sell-off strengthened toward the end of the day.
That late-afternoon burst of selling erased modest gains for the market, which was coming off two weeks of gains.
The major indexes wavered for much of the day between small gains and losses as investors weighed a mixed batch of earnings reports from McDonald's, Procter & Gamble and other big companies.
Weak profits and sales pulled shares in McDonald's lower. Travelers sank after the insurance company reported earnings that fell far short of analysts' forecasts. Meanwhile, traders bid up shares in Procter & Gamble after the consumer products maker raised its profit forecast for the year following surprisingly good third quarter earnings.
"We're still waiting to see how earnings season shakes out," said Karyn Cavanaugh, senior markets strategist at Voya Investment Management. "There have been some winners and some losers. There's been a couple of misses."
The S&P 500 index fell 10.73 points, or 0.4%, to 2,995.99. The index spent most of the day at or above 3,000 and briefly climbed 0.3% before the late-afternoon slide.
The Dow Jones Industrial Average dropped 39.54 points, or 0.2%, to 26,788.10.
The Nasdaq, which is heavily weighted with technology stocks, bore the brunt of the selling, losing 58.69 points, or 0.7%, to 8,104.30.
Smaller company stocks fared better than the rest of the market. The Russell 2000 index added 0.73 points, or 0.1%, to 1,550.87.
Bond prices rose. The yield on the 10-year Treasury note, which is a benchmark for the interest rates banks charge for mortgages and other loans, fell to 1.77% from 1.79% late Monday.
Investors have been shifting their focus to corporate earnings reports as they wait for developments in the trade negotiations between the U.S. and China.
Optimism over the latest round of talks, which for now have at least prevented the costly conflict from escalating further, helped put investors in a buying mood in recent weeks. The benchmark S&P 500 has notched weekly gains the past two weeks.
Analysts came into this latest earnings season expecting profits to decline overall for companies in the S&P 500. But with about 15% of companies in the index reporting so far, results have been surprisingly positive.
Earnings growth fell slightly in the first and second quarters, according to data from FactSet, which was better than Wall Street's expectation at the start of those reporting seasons.
"The market really moves on earnings," Cavanaugh said. "If we see a negative year-over-year earnings growth quarter, it's going to give the market a little bit of pause."
While some of the company earnings on Tuesday were surprisingly good, a few large companies gave investors disappointing results that tipped the market into the red.
Technology companies accounted for most of the selling. Microsoft dropped 1.5%. Payment processors Visa and Mastercard also fell, shedding 3.2% and 4.8%, respectively.
Communications services stocks also helped pull the market lower. Netflix led the slide, dropping 4.1%. Facebook lost 3.9% following news that a state-level antitrust investigation into the social networking giant now has the backing of a bipartisan group of 47 attorneys general.
McDonald's slid 5% after reporting that its third-quarter profit and revenue fell short of Wall Street forecasts. It was one of the big decliners among companies that rely on consumer spending.
Financial stocks also ended lower. Travelers sank 8.3% after the insurance company reported earnings that fell far short of analysts' forecast.
Companies with stronger quarterly results fared better.
Biogen soared 26.1% after the biotechnology giant handily beat Wall Street's third-quarter profit and revenue forecasts. It also said it will ask regulators to approve a treatment for Alzheimer's. The company's gains gave a strong shot to the broader health care sector.
Procter & Gamble rose 2.6% on its solid quarterly report card.
This will be another busy week for investors. Boeing, Caterpillar and Microsoft all report their results on Wednesday. American Airlines, Twitter and Amazon will report on Thursday.
Benchmark crude oil rose 90 cents to settle at $54.21 a barrel. Brent crude oil, the international standard, gained 74 cents to close at $59.70 a barrel. Wholesale gasoline was unchanged at $1.61 per gallon. Heating oil was unchanged at $1.94 per gallon. Natural gas rose 3 cents to $2.27 per 1,000 cubic feet.
Gold fell 70 cents to $1,481.70 per ounce, silver fell 9 cents to $17.44 per ounce and copper fell 2 cents to $2.62 per pound.
The dollar fell to 108.46 Japanese yen from 108.58 yen on Monday. The euro weakened to $1.1124 from $1.1146.
Stocks in Europe finished higher after British lawmakers on Tuesday approved Prime Minister Boris Johnson's Brexit deal in principle. However, they also rejected the government's fast-track attempt to pass the bill within days.
British Prime Minister Boris Johnson says he will "pause" the government's planned Brexit legislation.