Stocks rose sharply on Tuesday as investors welcomed a slew of quarterly corporate results and as a decline in borrowing costs for Spain eased concerns about Europe's debt crisis.

Profits at Coca-Cola Co , Goldman Sachs Group Inc and Johnson & Johnson all beat analysts' estimates and lifted hopes for the rest of the earnings season.

Apple Inc gained 4 percent to $603.61, putting shares of the iPad maker on track to snap a 5-day losing streak during which it lost 8.8 percent. The stock has been volatile recently after gaining about 45 percent this year.

Of the 39 S&P 500 companies that have reported earnings, 74.4 percent beat estimates, according to Thomson Reuters data.

Better-than-expected results from Spanish 12-month and 18-month debt sales pushed yields on Spain's 10-year bond below 6 percent, but a longer-term debt auction later in the week could be a more telling test.

It's a combination fueled on some slight resolution in Spain and improving profit conditions, said Jack Ablin, chief investment officer at Harris Private Bank in Chicago. There was a fair amount of a distrust discount built into the market.

The Dow Jones industrial average <.DJI> was up 201.13 points, or 1.56 percent, at 13,122.54. The Standard & Poor's 500 Index <.SPX> was up 21.19 points, or 1.55 percent, at 1,390.76. The Nasdaq Composite Index <.IXIC> was up 55.87 points, or 1.87 percent, at 3,044.27.

The S&P 500 continues to trade around its 50-day moving average after sinking below that level last week for the first time in more than three months. The moving average, currently at 1,377.35, is closely watched by traders.

Although not all the stocks of reporting companies rose, the results helped ease fears that earnings could start to tail off this quarter.

International Business Machines Corp reports earnings after the bell, and investors hope strong software demand will bring a repeat of last year's first-quarter performance, when the company raised its full-year forecast. The shares rose 1.8 percent to $206.30.

Yahoo Inc is also due to report after the close, but the results may be overshadowed by comments from its new chief executive, who is expected to lay out his vision for the struggling web pioneer. Shares gained 2.4 percent to $15.14.

Coca-Cola climbed 2.7 percent to $74.42 and was one of the top boosts to the Dow after the soft drink group reported higher quarterly profit.

Goldman rose 0.9 percent to $118.75 after earnings fell from a year earlier but topped many analysts' views.

Expectations were fairly low coming into first-quarter earnings season, and so far, the news has been surprisingly good, said Mark Luschini, chief investment strategist at Janney Montgomery Scott in Philadelphia.

We are accumulating some evidence that one, earnings are matching or exceeding expectations, and two, even in light of what's going on in Europe and the trepidation with regard to global growth, companies are able to continue to respond positively in terms of profitability.

Johnson & Johnson shares slipped 0.1 percent to $63.90 after its quarterly profit rose more than expected but revenue fell slightly.

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

Economic reports were mixed as groundbreaking on homes fell unexpectedly in March, but permits for future construction rose to their highest level in 3-1/2 years. The PHLX housing index <.HGX> gained 1.8 percent.

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.

(Editing by Padraic Cassidy and Jeffrey Benkoe)