By Anora Mahmudova, MarketWatch

NEW YORK (MarketWatch) -- U.S. stocks rallied Wednesday, and three days of gains sent the benchmark S&P 500 into positive territory for the year.

Markets got a boost from better-than-expected economic growth data in China and an upbeat industrial production report in the U.S., while positive earnings from Yahoo! Inc. (YHOO) and Intel Corp. (INTC) lifted tech stocks.

The S&P 500 (SPX) ended the day 19.33 points, or 1.1%, higher at 1,862.31. The Dow Jones Industrial Average (DJI) jumped 162.29 points, or 1%, to 16,424.85.

The Nasdaq Composite (RIXF) added 52.06 points, or 1.3%, to 4,086.23, recouping some of the heavy losses from last week.

Read a recap of the day in MarketWatch's live stock market blog..

Federal Reserve Chairwoman Janet Yellen, in a speech and a Q&A session, reiterated that the decision on interest rates would be based on employment and inflation, further boosting sentiment. The Fed's summary of economic conditions, known as the Beige Book, said the U.S. economy picked up in most of the country as the weather improved.

In economic news, data released by the Federal Reserve on Wednesday show industrial production grew more than forecast in March, thanks to mining and utility output.

Data on housing was not as upbeat. The U.S. Commerce Department's report on housing starts in March came in below expectations even though construction on new U.S. homes in March hit its fastest pace in three months.

Kim Caughey Forrest, senior equity analyst at Fort Pitt Capital, said markets reacted to the better-than-expected headline number on the industrial production report, but warned the numbers are still not great.

"It is still a flat economy and improving slowly. Housing starts data were weak and at this point, still difficult to say if it's weather related or that we hit a soft patch in the housing market," Forrest said.

Yahoo's best day in nine months

In earnings news, Yahoo Inc. (YHOO) jumped 6.3%, its best day in nine months, after quarterly earnings released late Tuesday beat estimates. The Internet company's first-quarter adjusted earnings were 38 cents a share.

Bank of America Corp. (BAC) reported a first-quarter loss of 5 cents a share, sending shares 1.6% lower. The bank recorded $6 billion in litigation expenses during the period. Read also: Live Blog: Bank of America Q1 earnings call.

Post Holdings Inc. (POST) shares rallied 5.7% following a report in The Wall Street Journal that it has beat out several other competitors, including Tyson Foods Inc. (TSN), to position itself to buy Michael Foods Group for about $2.5 billion.

Interactive Brokers Group Inc. (IBKR) shares jumped 12% after the firm said its profit surged, due largely to increased trading activity in its electronic brokerage unit.

St. Jude Medical Inc. (STJ) shares dropped 1.9% even as the company narrowly beat analysts estimates. The company said its first-quarter earnings rose 12% and raised it earnings per share estimate for the year. Also read: St. Jude gets the cold shoulder from investors after meager earnings beat.

Google, IBM, AmEx disappoint after hours

After the closing bell, several companies reported disappointing results.

Google Inc. shares slid after hours, erasing all of Wednesday's gains. The internet group missed Wall Street's earnings expectations for the first-quarter results. Class A shares in the company closed up 2.8% to $563.90. Both Class A shares (GOOGL) and Class C shares (GOOG) fell more than 5% in after-hours trade. Also read: Google first-quarter earnings call: Live blog

IBM Corp. (IBM) shares sid 3.8% after the company's revenue fell short of Wall Street expectations.

Shares in American Express Co (AXP) fell 1.5% as revenue disappointed investors.

In overseas markets, Asian and European stocks closed higher. Gold and oil prices ticked up.

More must-reads from MarketWatch:

Should you sell in April and go away?

Be wary when you hear 'This is the big stock crash'

Asia markets live blog: China GDP in focus

Subscribe to WSJ: http://online.wsj.com?mod=djnwires

International Business M... (NYSE:IBM)
Historical Stock Chart
From Feb 2024 to Mar 2024 Click Here for more International Business M... Charts.
International Business M... (NYSE:IBM)
Historical Stock Chart
From Mar 2023 to Mar 2024 Click Here for more International Business M... Charts.