Stocks rallied on Friday as interest rates slipped further from a four-year high, pushing the major indexes higher for the week.

The Dow Jones industrial average closed 347.51 points higher at 25,309.99, with Intel as the best-performing stock. The gained 1.6 percent to end at 2,747.30, with utilities and energy as the best-performing sectors. The broad index also broke above its 50-day moving average — a key technical level — in afternoon trade.

Entering Friday's session, the Dow and S&P 500 were on track to close down by 1 percent for the week. They finished the week with gains of 0.4 percent and 0.6 percent, respectively.

The Nasdaq composite advanced 1.8 percent to 7,337.39 as shares of Facebook, Amazon, Netflix and Alphabet all rose. For the week, the index rose 1.4 percent.

It was a volatile week for stocks, with the major averages posting strong gains in early trading before closing off those highs in the previous three sessions. On Friday, the Dow, S&P 500 and Nasdaq bucked that trend.

"We have a champagne problem," said Nick Raich, CEO of The Earnings Scout. "The economy is running too hot and that brings fear of higher rates. But that's better than having to jump-start an economy that's running cold."

"Earnings expectations are also rising for the first time in seven years," Raich said. "That's a big positive."

The benchmark 10-year U.S. note yield hit a four-year high earlier this week after minutes from the Fed's January meeting showed the central bank sees increased economic growth and an uptick in inflation as justification to continue to raise interest rates gradually. On Friday, the yield traded below that four-year high, near 2.875 percent.