The Dow Jones industrial average also notched a gain for the second day in a row. The Nasdaq bucked the trend, closing slightly lower.
Utilities stocks were among the biggest gainers as investors weighed a mix of U.S. economic data and corporate earnings news. The price of U.S. oil fell slightly, ending a second week in a row nearly flat just under $60 a barrel.
The Dow rose 20.32 points, or 0.1 percent, to 18,272.56. That’s within 16 points of its record set on March 2.
The S&P 500 index gained 1.63 points, or 0.1 percent, to 2,122.73. The Nasdaq slipped 2.50 points, or 0.1 percent, to 5,048.29. The three indexes are up for the month and year.
Trading got off to a sluggish start early Friday and remained mostly muted, with the major indexes hovering near their prior-day totals.
Separate reports on Friday offered a mixed assessment of U.S. manufacturing. The Federal Reserve said factory activity in New York increased slightly in May, suggesting that manufacturers are beginning to adapt to the challenges caused by a stronger dollar, lower oil prices and restrained consumer spending. Meanwhile, U.S. industrial output fell for the fifth straight month in April.
Other reports this week have also shown diverging trends for the U.S. economy. The Commerce Department’s U.S. retail sales report for April fell short of Wall Street’s forecasts. But the latest figures on applications for unemployment aid and inflation were more encouraging.
Seven of the 10 sectors in the S&P 500 index rose, led by utilities stocks. The sector remains down 6.7 percent this year. Financials fared the worst. The sector is down 0.3 percent for the year.
Companies reporting better-than-expected quarterly earnings or outlooks were among the big gainers Friday. Darling Ingredients climbed $1.55, or 11 percent, to $15.64.
Others failed to live up to expectations, however.
Dillard’s reported weak first-quarter financial results, which pulled the department store chain’s shares down 7 percent. The stock lost $8.74 to $115.46.
Keurig Green Mountain sank 8.6 percent as investors worried that the company’s new cold-drink machine is priced too high. The stock lost $8.81 to $94.26.
Bond prices rose. The yield on the 10-year Treasury note fell to 2.15 percent from 2.23 percent late Thursday.
In energy trading, benchmark U.S. crude fell 19 cents to close at $59.69 a barrel in New York. U.S. oil ended last week at $59.39 and the week before at $59.15. Brent crude for July delivery, a benchmark for international oil used by many U.S. refineries, fell 11 cents to close at $66.81 in London. The June Brent contract expired Thursday at $66.59.
In other futures trading on the NYMEX, wholesale gasoline fell 0.1 cent to close at $2.057 a gallon. Heating oil fell 0.1 cent to close at $2.005 a gallon. Natural gas rose 0.8 cents to close at $3.016 per 1,000 cubic feet.
Precious and industrial metals futures edged mostly higher. Gold increased 10 cents to $1,225.30 an ounce, silver also rose 10 cents to $17.56 an ounce and copper was unchanged at $2.92 a pound.