By Alexandra Scaggs 

U.S. stocks extended their winning streak Wednesday after a brief turn lower on jitters about the outlook for Federal Reserve policy.

Stocks had initially turned lower, and prices of ultrasafe Treasury bonds fell, after minutes from the Federal Reserve's latest policy-setting meeting indicated officials debated whether to raise interest rates sooner than expected.

The Dow Jones Industrial Average rose 59.54 points, or 0.4%, to 16979.13. The S&P 500 index gained 4.91 points, or 0.2%, to 1986.51.

Technology stocks lagged behind, with the Nasdaq Composite Index closing nearly flat, slipping less than 0.1% to 4526.48.

Wednesday was the third-straight advance for the Dow and the S&P 500, leaving the S&P just 0.1% below its all-time high. The session was quiet, however, with the third-lowest trading volume for a full session this year.

Stocks quickly recouped their losses in afternoon trading as investors brushed off the Fed minutes. Treasury prices also rose from their session lows, though the yield on the 10-year note still rose for the session, to 2.426%.

Traders and strategists said investors were looking ahead to a speech later this week from Fed Chairwoman Janet Yellen at an annual gathering of central bankers in Jackson Hole, Wyo. European Central Bank President Mario Draghi will speak as well.

"The minutes are backward-looking and Yellen's speaking Friday," said Michael Antonelli, sales trader with Robert W. Baird. "We're just kind of treading water until then."

Investors have been keeping a close eye on when the Fed could raise interest rates, with short-term rates having been held near zero since December 2008.

"Markets are nervous about what the Fed's [rate increase] is going to look like," said David Lebovitz, global markets strategist for J.P. Morgan Funds.

But some investors said that if economic growth remains steady and interest rates don't rise sharply, they are comfortable with a rate increase coming sooner than expected.

"They have to do it sooner or later," said Mark Spellman, who manages $80 million in the Alpine Equity Income Fund. "The question is, how high do they go? But in this case, it's safe to say it's going to be a very slow, deliberate process."

Still, Mr. Spellman is avoiding some stocks that could get hurt if interest rates rise, such as utilities shares. He has recently bought stocks of insurance companies such as Prudential Financial Inc. and MetLife Inc., which he expects will benefit from higher rates.

In corporate news, Home Depot led the Dow higher, gaining 2.9%. That advance came on the back of Tuesday's 5.6% gain on strong second-quarter earnings and upbeat housing-market data. Its competitor Lowe's rose 1.6% after reporting strong second-quarter results but lowering its sales outlook for the year.

PetSmart Inc. said it would explore strategic alternatives, including a possible sale. The company said it would implement a cost-reduction program. Shares rose 1.2%.

European stocks fell, with the Stoxx Europe 600 Index down 0.1%. In commodity markets, crude-oil futures rose 1.7% to $96.07 a barrel. Gold futures slipped 0.1% to $1,293.40 an ounce.

Write to Alexandra Scaggs at alexandra.scaggs@wsj.com