Stocks rose modestly on Tuesday after stronger-than-expected retail sales data, though gains were limited by some retailers' disappointing earnings.

U.S. retail sales rose in August at the fastest pace in 3 1/2 years, buoyed by government incentives for car purchases, according to the Commerce Department.

Limiting the gains were Best Buy Co Inc and Kroger, both of which reported quarterly results that missed expectations. Electronics store Best Buy fell 4.1 percent to $38.77 while grocer Kroger shed 8.4 percent to $20.26. The S&P Retail index <.RLX> was down 0.3 percent.

The government report on retail sales gave further evidence of an economic recovery, said Charles Lieberman, chief investment officer at Advisors Capital Management in Paramus, New Jersey.

I expect retail sales to continue to grow, and that's more interesting and important than any one or two companies reporting disappointing results, he said.

The Dow Jones industrial average <.DJI> rose 22.07 points, or 0.21 percent, to 9,646.45. The Standard & Poor's 500 Index <.SPX> rose 0.53 points, or 0.05 percent, to 1,049.87. The Nasdaq Composite Index <.IXIC> gained 6.14 points, or 0.29 percent, to 2,097.96.

Financial companies, meanwhile, reported worsening consumer credit. JPMorgan Chase & Co said its annualized credit card charge-off rate rose to 8.73 percent in August, while Discover Financial said credit card defaults hit a 26-year high.

JPMorgan fell 0.6 percent to $43.48 while Discover was off 1.4 percent to $14.82.

In addition, Capital One said accounts at least 30 days delinquent, an indicator of future loan losses, rose in August, sending its stock down 3.7 percent to $36.91.

The Nasdaq got a boost after analysts' upgrades of Web auctioneer eBay and Internet company Yahoo . Yahoo shares climbed 4.2 percent to $16.22 while eBay added 2 percent to $24.30.

Shares of Citigroup Inc fell 4.9 percent to $4.30 after sources said the bank is in talks with U.S. officials about how to shed the roughly one-third stake the federal government acquired as part of its bailout of the company.

Federal Reserve Chairman Ben Bernanke, speaking at the Brookings Institution on the one-year anniversary of the collapse of Lehman Brothers , said the recession is very likely over.

(Reporting by Ryan Vlastelica; Editing by Kenneth Barry)