Stocks End Flat, but Post Best Jan. Since 1997

Stocks came off their worst levels but still finished narrowly mixed Tuesday, after a handful of disappointing economic news weighed on the market. Despite the session's lackluster performance, the Dow and S&P are still posted their best January since 1997.

In addition, all three major averages logged their best monthly gains since October.

The Dow Jones Industrial Average declined 20.81 points, or 0.16 percent, to finish at 12632.91, led by ExxonMobil and Alcoa.

The S&P 500 slipped 0.60 points, or 0.05 percent, to end at 1,312.41. The Nasdaq squeezed out a gain of 1.90 points, or 0.07 percent, to close at 2813.84.

The CBOE Volatility Index, widely considered the best gauge of fear in the market, ended near 19.

Among key S&P sectors, financials logged a gain,while energy sagged.

For the month, the Dow rallied 3.4 percent, the S&P 500 jumped 4.36 percent, and the Nasdaq surged 8.01 percent.

Interestingly, the last five times the S&P logged a gain of more than 4 percent in January, the index posted a robust annual average gain of 23 percent. (Read More: What Happens After a Strong January?)

“Overall, we’re looking at a solid month and some type of consolidation makes sense to us,” said Ryan Detrick, senior technical strategist at Schaeffer’s Investment Research. “All in all, we’re continuing to talk about Europe…it’s still the wildcard.”

Detrick noted that a stronger market performance in January points to a more bullish year and maintained his 1,450 year-end target on the S&P 500.

On the economic front, home prices fell 1.3 percent last November, according to S&P/Case-Shiller's 20-city composite index, adding to the 0.7 percent drop seen in October. Economists had expected a decline of 0.5 percent.

Consumer confidence posted an unexpected decline in January, dropping to 61.1 from an upwardly revised 64.8 in the previous month, according to the Conference Board. Economists had expected the index to hit 68.0, according to a Reuters survey.

“We’d be anticipating a two-steps forward, one-step back pattern and this is the one-step back,” said Detrick. “As long as the jobs numbers stay on the right path, consumer confidence will go up as well.”

In addition, business activity in the Midwest slid to its lowest level since August, according to the Institute of Supply Management-Chicago business barometer.

European stocks reversed sharp two-day declinesfollowing the approval of the budget discipline pact. However, gains were limited by the mounting tension surrounding Portugal's debt woes, with the nation's two-year bond yields hitting a euro-era record above 21 percent.

Financials including Goldman Sachs and Morgan Stanley were buoyed by optimism from Europe.

BofA gained after Guggenheim raised its price target on the bank to $9 from $6.50.

Meanwhile, Standard & Poor's warned it may downgrade "a number of highly rated" G20 nationsfrom 2015 if their governments fail to enact reforms to curb rising health care spending.

Among earnings, Exxon posted profit that narrowly beat estimates as rising crude oil prices offset declining margins for chemicals, engine lubricants and fuel. Still, the oil giant's shares slipped, leading the blue-chip index lower. Rival Chevron also nudged lower.

Pfizer reported sharply lower quarterly earnings, hurt by generic forms of its Lipitor cholesterol drug. In addition, the drugmaker cut its 2012 forecasts.

Meanwhile, Eli Lilly posted earnings that plunged 27 percent as its schizophrenia treatment lost patent protectionand ran into competition from generic rivals.

RadioShack plunged nearly 30 percent to hit a three-year low a day after the electronics retailer warned of a decline in fourth-quarter profit. At least five brokerages slashed their price targets on the firm. Rival Best Buy also fell following the news.

And United Parcel Services slipped even after the package delivery company reported earnings that beat Wall Street expectations.

Meanwhile, Mattel rallied after the toymaker reported better-than-expected earnings. In addition, Sterne Agee raised its price target on the firm to $38 from $34.

Nearly 60 percent of the 204 companies in the S&P 500 that have posted earnings results so far have topped estimates, tracking far below the average beat rate at this stage of the earnings season.

Amazon.com and Broadcom are scheduled to report earnings after-the-bell tonight.

In politics, Republican voters in Florida will go to the polls later in the day in the presidential primary election that could determine the direction of the race. The race looks set to take place between former Massachusetts governor Mitt Romney, who holds a firm lead in opinion polls, and former House speaker Newt Gingrich.

—Follow JeeYeon Park on Twitter: twitter.com/JeeYeonParkCNBC

Coming Up This Week:

WEDNESDAY: Weekly mortgage applications, Challenger job-cut report, ADP employment report, Fed's Plosser speaks, ISM mfg index, construction spending, oil inventories, auto sales; Earnings from Aetna, Marathon Oil, Qualcomm, Electronic Arts
THURSDAY: Jobless claims, productivity and costs, Fed's Fisher speaks, chain-store sales; Earnings from AstraZeneca, Deutsche Bank, Merck, Royal Dutch Shell, Sony, Unilever, beazer Homes
FRIDAY: Employment situation, factory orders, ISM non-mfg index; Earnings from Clorox

More From CNBC.com: