NEW YORK -- The stock market closed out its best week of the year on Friday as investors focused on company earnings and brushed off another weak economic report.

Campbell Soup climbed after reporting earnings that beat the estimates of Wall Street analysts. Cliffs Natural Resources, a mining company, also jumped after its earnings beat analysts’ expectations and the company named a new Chief Executive Officer.

The Standard & Poor’s 500 has wiped out almost all of its loss for the year after a big slump in January, and is now just 10 points below its record close of 1,848 reached Jan. 15. Stocks slumped last month because of concerns about the outlook for growth in China and other emerging markets and worries about the health of the U.S. economy.

"For all practical purposes, we’re back," said Jonathan Golub, Chief U.S. Market Strategist at RBC Capital Markets. "We’ve effectively recovered this pullback."

The S&P 500 rose 8.80 points, or 0.5 percent, to 1,838.63. For the week, the index rose 2.3 percent.

The Dow Jones industrial average rose 126.80 points, or 0.8 percent, to 16,154.39. The Nasdaq composite rose 3.35 points, or 0.1 percent, to 4,244.03, its highest close since July 2000.

The stock market got a lift on Tuesday when Janet Yellen, the new head of the Federal Reserve, said she would continue the central bank’s low-interest rate policies and as Congress moved toward raising the U.S. borrowing limit without the political drama of last year.