U.S. stocks closed narrowly mixed Tuesday, as some encouraging earnings reports offset pressure from declines in oil prices and continued geopolitical concerns. (Tweet This)
The major averages struggled to hold higher in late afternoon trade, giving up intraday gains that briefly took the S&P 500 into positive territory for the year and pushed the Dow Jones industrial average up more than 100 points.
The Dow Jones industrial average and Nasdaq composite eked out gains, while the S&P 500 ended lower as utilities and energy lagged.
"With the Fed minutes tomorrow, anything that seems to have short-term risk, people want to stay away if possible," said JJ Kinahan, chief strategist at TD Ameritrade.
During the afternoon U.S. trading session, two stadiums in Germany were evacuated at short notice.
At one venue, concert-goers had been waiting for the band "Soehne Mannheims" to play. Separately, a soccer game between Germany and the Netherlands due to the serious threat of an attack at the stadium on Tuesday, the Associated Press reported. A German official later said no explosives were found and no arrests were made.
"That's definitely contributing to some downside in stocks. I think we were near-term overbought. ... Maybe the market's starting to look ahead as well," said John Caruso, senior market strategist at RJO Futures.
The Dow ended about 6 points higher after earlier gaining more than 100 points, helped primarily by a more than 4 percent gain in Home Depot on a solid earnings report. The second-largest contributor to gains, Wal-Mart, briefly jumped 5 percent on good quarterly results.
The reports break last week's trend of several disappointing retailer earnings last week.
Goldman Sachs was the greatest weight on the Dow.
"There's a lot of nervousness in the air and investors are selling first and asking questions later," said Adam Sarhan, CEO of Sarhan Capital.
Health care, telecommunications and consumer discretionary were the only advancers in the S&P 500, which briefly joined the Nasdaq composite in positive territory for 2015 in intraday trade. The Dow Jones industrial average is still more than 1 percent lower year-to-date.
"The gains from Home Depot has helped. (It shows) the consumer is spending in select areas. I think it's also a slight continuation of yesterday," said Robert Pavlik, chief market strategist at Boston Private Wealth. He has holdings in Home Depot but not Wal-Mart.
"The market is probably going to trade somewhat in lockstep with oil," Pavlik said. He expects crude to bottom near $30 a barrel and said investors are increasingly focused on crude's struggle to stay above $40 a barrel.
Energy ended more than 1 percent lower, following a reversal in oil prices after Monday's gains.
"I think basically the market is reflecting the fact now the Fed comes back into play and oil prices are weak and we're seeing that weigh on the market," said Peter Cardillo, chief market economist at First Standard Financial.
U.S. crude oil futures settled down $1.07, or 2.56 percent, at $40.67 a barrel, while brent held near $43.60 a barrel as focus returned to global oversupply.
Crude gained 2.45 percent Monday, boosted by geopolitical concerns following weekend terror attacks in Paris.
"The market has come to realize that in the short term these are not hugely market-moving events. ... But the tragedy in Paris Friday has real political implications for not only the refugee crisis but also (German Chancellor Angela) Merkel's position in Germany and I don't think it's overstating that Merkel has been (crucial) to keeping Europe together," said David Lafferty, senior vice president and chief market strategist at Natixis Global Asset Management.
"The environment (trading) is occurring in I think is one in which investors are very confused," he said. "After the China selloff and the market rebound, the market has been directionless."
In economic news, the consumer price index rose 0.2 percent in October, matching estimates. The so-called core CPI, which takes out food and energy costs, gained 0.2 percent. In the 12 months through October, core CPI increased 1.9 percent.
"I wouldn't call it a market-moving number but it showed continued progress in terms of what the Fed is looking for," Lafferty said.
Dow futures held about 60 points higher after briefly adding 100 points prior to the data release.
"I think the geopolitics is always going to be simmering in the backdrop. We came into the week pretty oversold, caught a bid yesterday and that's continuing today," said Art Hogan, chief market strategist at Wunderlich Securities.
"Retailers may have an opportunity to trade up with the halo effect," he said.
In other data reports, home builder confidence fell more than expected to 62 in November.
Industrial production for October showed a second-straight month of decline with a 0.2 percent drop, missing expectations for a slight rise.
Treasury yields came off session highs, with the 10-year yield near 2.27 percent and the around 0.86 percent in early afternoon trade.
The U.S. dollar held near 7-month highs, trading mildly higher against major world currencies, with the euro near $1.064 and the yen at 123.40 yen against the greenback in the close.
European stocks surged Tuesday, with the STOXX Europe 600 up more than 2 percent, as markets found confidence from euro zone data.
Most major Asian indexes closed more than 1 percent higher Tuesday, with only the Shanghai composite ending a touch lower. The rally followed gains of more than 1 percent in U.S. stocks Monday on the sharp jump in oil prices.
"Improved intraday momentum has allowed for short-term oversold "buy" signals around the world (based on upturns in the daily stochastics)," BTIG Chief Technical Strategist Katie Stockton said in a morning note. "We think that the ability of global equity benchmarks to gap up in the face of geopolitical risk reveals the positive seasonal influences that are at hand."
Investors also eyed some speeches from Federal Reserve members ahead of Wednesday's release of the Fed meeting minutes.
Introducing central clearing to tri-party and bilateral repo trading could help reduce "fire sales" and liquidity risks, and add more transparency to sometimes murky U.S. markets, Fed Governor Jerome Powell said in a Reuters report.
Federal Reserve Governor Daniel Tarullo said in a Reuters article that the United States is in a "grace period" of lowered financial risk but should address the potential for increased problems to develop in the financial system's non-bank sector.
Former Fed Chairman Ben Bernanke is due to speak after the close.
Home Depot closed up 4.4 percent after posting earnings that topped expectations on revenue that roughly matched estimates. The home improvement retailer reported a greater-than-expected rise in same-store sales both globally and in the United States. Home Depot's earnings outlook for the full year is also above analyst forecasts.
Wal-Mart ended 3.5 percent higher after reporting quarterly profit that beat estimates by 1 cent, with revenue essentially in line. The retail giant's comparable store sales matched expectations, while the full-year forecast is largely above Street consensus.
Home Depot is up 20 percent year-to-date, while Wal-Mart is off 30 percent for the year so far.
Dick's Sporting Goods closed down 9.4 percent after reporting quarterly earnings 1 cent below estimates on revenue that was very slightly above forecasts. Comparable store sales rose 0.4 percent, missing estimates of 2.1 percent. The stock is down about 25 percent year-to-date.
Shares of GNC, Vitamin Shoppe and Herbalife fell following news the U.S. Department of Justice said it would unveil results of an investigation related to illegal advertising and sales. However, the stocks closed off session lows after the probe did not implicate any of the firms.
The closed down 2.75 points, or 0.13 percent, at 2,050.44, with utilities leading seven sectors lower and health care the greatest advancer.
The Nasdaq closed up 1.4 points, or 0.03 percent, at 4,986.01. Apple closed 0.4 percent lower, while the iShares Nasdaq Biotechnology ETF (IBB), ended up 1.3 percent.
The CBOE Volatility Index (VIX), widely considered the best gauge of fear in the market, held near 19.
About three stocks declined for every two advancers on the New York Stock Exchange, with an exchange volume of nearly 1.1 billion and a composite volume of 4.4 billion.
Gold futures settled down $15.00 at $1,068.60 an ounce.
—Wires and CNBC's Peter Schacknow contributed to this report.
On tap this week:
4 p.m.: TIC data
4:10 p.m.: Former Fed Chairman Ben Bernanke on panel at Brookings
Earnings: Target, Lowe's, Staples, Salesforce.com, L Brands, Keurig Green Mountain, Fresh Market, Children's Place
New York Fed's William Dudley, Cleveland Fed's Loretta Mester, Atlanta Fed's Dennis Lockhart on panel at Clearing House Conference
8:30 a.m.: Housing starts
Noon: Dallas Fed President Rob Kaplan on economy and policy
Noon: Bernanke at Economic Club of New York luncheon
2 p.m.: FOMC Minutes
Earnings: Gap, Best Buy, Buckle, Williams Sonoma, Autodesk, JM Smucker, Intuit, Ross Stores, Mentor Graphics
8:30 a.m.: Initial claims
8:30 a.m.: Philadelphia Fed survey
12:30 p.m.: Atlanta Fed's Lockhart at Dekalb Chamber of Commerce
4:45 p.m.: Fed Vice Chairman Stanley Fischer on emerging Asia
Earnings: Abercrombie and Fitch, Foot Locker
9 a.m.: St. Louis Fed President James Bullard on economy and monetary policy
1 p.m.: San Francisco Fed President John Williams on monetary policy
*Planner subject to change.
More From CNBC.com: