U.S. stocks scored their biggest gains in a month on Tuesday after Coca-Cola led a round of strong earnings and as concerns about Europe's debt crisis eased as Spanish bond yields fell.

Apple Inc shares ended a five-day losing streak with a rally of 5.1 percent, helping the Nasdaq Composite close above 3,000. The stock closed at $609.70 and booked its best day in almost three months after it dropped 8.8 percent in the previous five sessions.

IBM, Intel and Yahoo all beat earnings estimates in their reports after the closing bell.

Earlier in the day, Coca-Cola, Goldman Sachs and Johnson & Johnson all reported profits that beat analysts' estimates, in what has been a surprisingly strong start to earnings season.

People were very pessimistic, marking down earnings expectations so there was plenty of room for the market to be positively surprised, said Paul Zemsky, the New York-based head of asset allocation at ING Investment Management.

The stocks of companies whose results exceeded forecasts did not all rise. But the better-than-expected results helped ease fears that earnings could start to tail off this quarter. Of the 39 S&P 500 companies that had reported earnings before Tuesday's opening bell, 74.4 percent beat estimates, according to Thomson Reuters data.

German analyst and investor confidence rose unexpectedly in April to a high not seen since June 2010 while better-than-expected results from Spanish debt sales boosted confidence before a long-term debt auction later in the week.

ING's Zemsky said it was hard for any market to dismiss the significantly stronger-than-expected German survey.

The benchmark Spanish 10-year note's yield slipped below 6 percent, but worries about Madrid's finances and the banking sector are likely to keep the pressure on in coming days.

The Dow Jones industrial average rose 194.13 points, or 1.50 percent, to close at 13,115.54. The S&P 500 Index gained 21.21 points, or 1.55 percent, to 1,390.78. The Nasdaq Composite climbed 54.42 points, or 1.82 percent, to 3,042.82.

In Tuesday's rally, each of the three major indexes booked their largest percentage gains since March 13.

The S&P 500 closed just shy of its 14-day moving average and easily cleared its 50-day average, suggesting a turn in momentum after the recent pullback. The benchmark dipped below the 50-day line last week for the first time in more than three months.

International Business Machines Corp reported a 15 percent increase in first-quarter earnings after the bell and raised its full-year outlook.

IBM's stock led the Dow in the regular session with a 2.3 percent advance to end at $207.45, but gave up the gains after the bell.

Yahoo Inc reported a modest uptick in first-quarter revenue and beat Wall Street's profit targets when it reported its results after the bell. Yahoo's stock gained 1.5 percent to $15.01 in regular trading and extended gains 2.8 percent to $15.43 after hours.

Coca-Cola climbed 2.1 percent to $73.95 in regular trading and gave one of the top boosts to the Dow after the world's largest soft drink maker reported higher quarterly profit.

Goldman Sachs fell 0.7 percent to $116.86 after rising 2.8 percent during the previous four sessions. Earnings fell from a year earlier, but topped many analysts' views.

Johnson & Johnson shares edged up 0.4 percent to $64.22 after its quarterly profit rose more than expected even as revenue fell slightly.

This week, 86 S&P 500 companies are scheduled to report results.

U.S. economic reports were mixed as U.S. housing starts fell unexpectedly in March, but permits for future construction rose to their highest level in 3-1/2 years. The PHLX housing index gained 1.53 percent.

U.S. industrial output was flat for a second straight month in March, held back by a drop in manufacturing, a Federal Reserve report showed, while capacity utilization, a measure of how fully firms are using their resources, fell.

More than three issues rose for every one that fell on both the New York Stock Exchange and the Nasdaq.

About 6 billion shares changed hands on the NYSE, the Nasdaq and NYSE Amex, below the year-to-date average of about 6.78 billion.

(Reporting by Rodrigo Campos; Editing by Jan Paschal)