San Francisco Federal Reserve Bank President John Williams late on Thursday said if the U.S. central bank waited too long to raise rates, it could be costly for the economy and that a possible rate hike in September should be in play.

The comments added to statements perceived as hawkish from New York Fed President William Dudley earlier in the week.

Investors also are bracing for next week's meeting of global central bankers in Jackson Hole, Wyoming, where Fed Chair Janet Yellen may provide insight on the rate outlook.

The market's recent run-up to record highs has been partly supported by expectations that the Fed will continue to keep rates low, as well as by some upbeat earnings and economic news.

"Equities are ending this week largely unchanged. The dog days of summer are among us, earnings season is over and investors are in pause mode with the popular indices near all-time highs," said Terry Sandven, chief equity strategist at U.S. Bank Wealth Management in Minneapolis.

"I think we're going sideways for a month or so as we await visibility. In the absence of earnings data, I think the Fed will take center stage."

The Dow Jones industrial average ended down 45.13 points, or 0.24 percent, to 18,552.57, the S&P 500 lost 3.15 points, or 0.14 percent, to close at 2,183.87 and the Nasdaq Composite dropped 1.77 points, or 0.03 percent, to 5,238.38.

For the week, the Dow was down 0.1 percent, the S&P 500 was down 0.01 percent and the Nasdaq was up 0.1 percent.

The benchmark S&P 500 index remains up 6.8 percent for the year so far.

The energy index was down 0.8 percent.

Among the day's gainers, Applied Materials rose 7.1 percent to $29.64 after the chip equipment maker gave a strong current-quarter profit forecast.

Also, Deere was up 13.5 percent at $87.32 after the farming machinery maker raised its full-year profit outlook.

Declining issues outnumbered advancing ones on the NYSE by a 1.45-to-1 ratio; on Nasdaq, a 1.11-to-1 ratio favored decliners.

The S&P 500 posted 20 new 52-week highs and no new lows; the Nasdaq Composite recorded 102 new highs and 22 new lows.

Volume was low. Just 5.7 billion shares changed hands on U.S. exchanges, compared with the 6.4 billion daily average for the past 20 trading days, according to Thomson Reuters data.