Trader Joseph Lawler at the New York Stock Exchange, Thursday,...

Trader Joseph Lawler at the New York Stock Exchange, Thursday, June 29, 2017. Credit: AP / Richard Drew

Wall Street closed out the final day of the second quarter with slight gains after a broad rally faded in the last few minutes of trading Friday.

The Dow Jones industrial average and the Standard & Poor’s 500 index eked out tiny gains, while the Nasdaq composite closed essentially flat.

Industrial stocks and consumer-focused companies led the gainers. Energy stocks also rose as crude oil prices closed higher for the seventh straight day. Utilities, technology and health care companies were among the biggest decliners.

Trading was mostly subdued ahead of the Independence Day holiday next week, though many investors seized on the final trading day of the quarter and the previous day’s market slide to buy more shares or close out positions and book profits.

“Overall we’re ending this quarter with a strong market, even though technology has taken a hit, other sectors have moved up,” said Quincy Krosby, chief market strategist at Prudential Financial.

The S&P 500 index rose 3.71 points, or 0.2 percent, to 2,423.41. The Dow gained 62.60 points, or 0.3 percent, to 21,349.63. The Nasdaq lost 3.93 points, or 0.1 percent, to 6,140.42. The Russell 2000 index of small-company stocks gave up 0.84 points, or 0.1 percent, to 1,415.36.

Bond prices fell. The 10-year Treasury yield rose to 2.30 percent from 2.27 percent late Thursday.

NewsdayTV's Doug Geed visits two wineries and a fish market, and then it's time for holiday cheer, with a visit to a bakery and poinsettia greenhouses. Credit: Randee Dadonna

Out East with Doug Geed: Wine harvests, a fish market, baked treats and poinsettias NewsdayTV's Doug Geed visits two wineries and a fish market, and then it's time for holiday cheer, with a visit to a bakery and poinsettia greenhouses.

NewsdayTV's Doug Geed visits two wineries and a fish market, and then it's time for holiday cheer, with a visit to a bakery and poinsettia greenhouses. Credit: Randee Dadonna

Out East with Doug Geed: Wine harvests, a fish market, baked treats and poinsettias NewsdayTV's Doug Geed visits two wineries and a fish market, and then it's time for holiday cheer, with a visit to a bakery and poinsettia greenhouses.

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME