Worries over the next rate hike superseded joy over the four-day rally in crude oil on Tuesday, sending stocks into the red and away from their record highs.

The S&P 500 was down 0.55%, the Dow Jones Industrial Average fell 0.45%, and the Nasdaq slipped 0.66%.

Slightly more hawkish commentary from the Federal Reserve's William Dudley and Dennis Lockhart on Tuesday increased the chances of a near-term rate hike. 

New York Fed President Dudley backed an increase sooner rather than later, telling Fox Business Network that the central bank was "edging closer towards the point in time where it will be appropriate I think to raise interest rates further." The Fed initially raised rates in December, the first increase in nearly a decade.

Atlanta Fed President Lockhart added to the conversation later on Tuesday. The economic recovery and second-half outlook likely warrants "at least one" interest rate hike this year, he said in an afternoon speech. 

"Early indications of third-quarter GDP growth suggest a rebound," he said to the Rotary Club of Knoxville, Tenn. "I, as one Fed policymaker, am not prepared to rule out at least one rate hike before year's end."

A September rate hike currently has an 18% likelihood, according to CME Group fed funds futures, up from a previous 12%. A December hike has greater chances with investors pricing in a 45% likelihood.

Oil prices continued to move higher in day four of a rally inspired by hopes over an output freeze from major oil-producing countries. The Organization of Petroleum Exporting Countries is set to meet next month and in recent days members including Saudi Arabia and Russia have suggested a willingness to discuss a production freeze deal.

West Texas Intermediate crude oil, the U.S. benchmark, rose 1.86% to $46.59 a barrel on Tuesday.

Stock losses followed another record-making trifecta for Wall Street on Monday as stocks got a big boost from another rally in crude oil. The S&P 500 and Dow hit new records, breaking the highs seen last Thursday, while the Nasdaq added to records achieved on Friday. All-time intraday highs were also reached.

Better-than-expected economic data also supported the case for a near-term rate hike. Industrial production in July came in more than double estimates as currency headwinds faded. Housing starts climbed 5.6% from a year earlier, the second-best increase since the recession.

U.S. consumer prices were unchanged in July, the Labor Department reported Tuesday. Consumer prices have risen 0.2% in the past year, the smallest increase since March 2010, as weaker energy prices drag down the headline number. Core consumer prices, which excludes volatile food and energy prices, increased 2.2% over the past 12 months.

"The CPI was unchanged in July as energy prices fell and core inflation softened," Wells Fargo analysts wrote in a note. "The weaker print in core inflation, however, stemmed from the more volatile components and is not the start of a new trend."

In earnings news, BHP Billiton (BHP) added 1.5% despite reporting a massive annual loss, its worst ever, and slashing its dividend. The Australian miner reported a net loss of $6.39 billion, compared to profit of $1.91 billion a year earlier. Analysts had expected a net loss of $5.8 billion. BHP cut its dividend by 77%.

Home Depot (HD - Get Report) raised its full-year forecasts as a robust housing market fueled demand for DIY products. The home-improvement retailer expects full-year earnings of $6.31 a share, up from its previous target of $6.27 a share. Home Depot also improved upon quarterly profit and sales, reporting earnings of $1.97 a share, up from $1.73 a share a year earlier. Revenue rose nearly 7% to $26.47 billion.

Dick's Sporting Goods (DKS - Get Report) rose by 7% after exceeding analysts' quarterly estimates and issuing upbeat current-quarter guidance. The sports retailer earned 82 cents a share, up from 77 cents a year earlier and above consensus of 69 cents. Third-quarter earnings guidance of 39 cents to 42 cents a share, above estimates of 38 cents a share. Full-year guidance was also increased.

Hain Celestial (HAIN - Get Report) tanked by 26% after being hit with downgrades at Piper Jaffray, Wedbush and Barclays. Hain delayed the release of its full-year results and announced accounting concerns overnight.