By Alexandra Scaggs 

U.S. stocks got back on track to extend a two-session winning streak Wednesday, after a brief turn lower on jitters about the outlook for Federal Reserve policy.

Stocks 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 rates sooner than expected.

But stocks recouped most of their losses shortly afterward, and Treasury prices slipped from their session highs. Traders and strategists said that investors were more likely to brush off the minutes since Fed Chairwoman Janet Yellen is scheduled to speak Friday.

"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."

The Dow Jones Industrial Average recently traded up 59 points, or 0.3%, to 16978. The S&P 500 index gained five points, or 0.2%, to 1986. Technology stocks lagged, with the Nasdaq Composite Index flat, gaining less than 0.1% to 4528.

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 hike] is going to look like," said David Lebovitz, global markets strategist for J.P. Morgan Funds.

But the stock-market move was relatively muted, as investors looked ahead to the annual gathering of central bankers in Jackson Hole, Wyo., where Ms. Yellen and European Central Bank President Mario Draghi are scheduled to speak later this week.

"That is where the market is directing a lot of its focus," said Mr. Lebovitz.

The persistently low interest rates have supported stock-market gains this year by keeping bond yields low and pushing investors to search for yield in riskier parts of the market.

As a result, "you're getting a lot of people crowded into pretty small spaces where they think there's opportunity," said Ralph Segall, chief investment officer of Segall Bryant & Hamill, which manages $9.5 billion. "This is a time you're worried about making sure you don't get run over."

Mr. Segall said that U.S. stocks could be vulnerable to a sharp selloff if investors' hunt for yield changes course when the Fed signals it will raise rates. As a result, his team has been buying stocks that trade at relatively low valuations, in hopes those stocks will hold up if broader stock benchmarks take a dive.

Stocks in the U.S. and Europe have recently staged a recovery from a mid-July pullback, which was sparked by a bout of geopolitical fears and concerns about the end of the Fed's loose monetary policy. As of Tuesday's close, the Dow was off 1.3% from its July 16 record and the S&P was just 0.3% below its July 24 record.

European stocks fell, with the Stoxx Europe 600 Index down 0.1%.

In corporate news, Home Depot led the Dow higher, gaining 3%. 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.9% 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.1%.

In commodity markets, crude-oil futures rose 0.6% to $93.38 a barrel. Gold futures slipped 0.4% to $1,291.60 an ounce.

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