U.S. stocks closed slightly higher Friday, turning in their largest weekly gains in months, as Federal Reserve Chairwoman Janet Yellen signaled a rate hike may be justified over the summer. The Dow Jones Industrial Average DJIA, -0.87% rose 44.93 points, or 0.3%, to close at 17,873.22, gaining 2.1% for the best weekly performance since March 18. The S&P 500 Index SPX, -1.11% , advanced 8.96 points, or 0.4%, to finish at 2,099.06, for a 2.2% weekly gain, the strongest since March 4. The Nasdaq Composite Index COMP, -1.07% rose 31.74 points, or 0.7%, to close at 4,933.50, for a 3.3% weekly gain, the best week since Feb. 19.