Large technology and health care companies and smaller firms rose again Friday as stocks finished the third quarter at record highs.

Stocks were mixed at the start of trading, as they had been the day before. But chipmakers and big-name technology companies pulled stocks higher, as they have done all year. Health care companies also did better than the rest of the market. Tyson Foods climbed after it gave strong profit forecasts, and investors cheered strong quarterly results from homebuilder KB Home.

advertisement | advertise on newsday

The market ended the quarter on a four-day winning streak that began after Federal Reserve Chair Janet Yellen said the central bank plans to continue to raising interest rates.

“It’s all about the confidence they have that despite low inflation, it still makes sense to raise interest rates,” said Randy Frederick, vice president of trading and derivatives at the Schwab Center for Financial Research.

The Standard & Poor’s 500 index rose 9.30 points, or 0.4 percent, to 2,519.36. The Dow Jones industrial average turned higher to finish with a gain of 23.89 points, or 0.1 percent, at 22,405.09. The Nasdaq composite jumped 42.51 points, or 0.7 percent, to 6,495.96. The S&P 500 and Nasdaq both closed at all-time highs.

The Russell 2000 index of small-company stocks added 2.08 points, or 0.1 percent, to 1,490.86. It’s also at record highs after a big rally this month.