The Dow Jones Industrial Average pared gains and the rest of Wall Street came off highs by mid-afternoon as crude oil made a surprise turn into the red.

The S&P 500 added 0.38%, the Dow was flat, and the Nasdaq rose 0.62%.

Crude oil tumbled on Thursday afternoon heading into its close. Prices had been higher earlier in the session on continued hopes of a production freeze agreement among major oil producers. Saudi Energy Minister Khalid al-Falih added to hopes on Thursday after expressing his confidence that Organization Petroleum Exporting Countries would follow through on the details of a deal sketched out at a meeting in Algeria in September. OPEC will meet in Vienna on Nov. 30.

"After three months of build-up, we agree that some deal to limit output is likely since OPEC has to be aware that the failure to finalize an agreement would have strongly bearish price implications," said Tim Evans, energy futures specialist at Citi. "At the same time, however, we remain skeptical that OPEC can execute the full pivot from no limits at all to an effective quota system in one step."

West Texas Intermediate crude was down 0.6% to $45.32 a barrel by the middle of the afternoon session.

Federal Reserve Chair Janet Yellen reinforced the chances of a rate hike in December, telling lawmakers that an interest rate hike could come "relatively soon." Yellen noted that the labor market continued to show strength and that the economy appeared to have recovered from a sluggish start to the year. Yellen also repeated the stance that the current state of the economy will likely "warrant only gradual increases in the federal funds rate over time" and noted that a delay could impact financial stability.

Yellen also said she did not foresee any reason why she would not complete her full term. Yellen's four-year term will end on Feb. 3, 2018. She also backed the Dodd-Frank regulations and cautioned against repealing them, noting that it is imperative to have safeguards that "result in a safer and sounder financial system."

The comments were made to the Congressional Joint Economic Committee on Thursday morning. The Fed chair last testified before that committee in December of last year, prior to the Fed's decision to hike interest rates for the first time in nearly a decade.

A December rate hike already had a high probability among Wall Street pundits with any doubt after Donald Trump's recent election as U.S. president quickly evaporating. The chances of a December rate hike currently sit at 90%, according to CME Group fed funds futures.

"The anticipated Trump agenda which includes lower tax rates and increased fiscal spending are inflationary and therefore support the future rate hikes," added Jennifer Ellison, principal at wealth management firm BOS. "In fact, the Federal Reserve will likely announce that they are still on track to raise rates once or twice in 2017, if not more. If these policies translate to greater economic growth, the Fed will likely become more aggressive about how quickly they raise rates in the coming year."

Consumer prices in the U.S. got a boost from higher gas prices in October. The inflation metric climbed 0.4% in October and 1.6% over the past 12 months, its highest level in two years. Core prices, excluding energy, rose 0.1% in October and 2.1% year over year. This consumer prices report is the last before the Fed meets in December and largely backs up the trend of inflation moving toward the Fed's 2% target.

Housing starts in October surged 25.5% to an annual rate of 1.32 million, the Census Bureau reported on Thursday. The measure hit a nine-year high in another sign of robust housing demand. Homebuilder permits increased by 0.3% to a rate of 1.23 million.

U.S. jobless claims held at their lowest level since 1973 over the past week. The number of new claims for unemployment benefits declined by 19,000 to 235,000, according to the Department of Labor. The less-volatile, four-week average fell 6,500 to 253,500.

Manufacturing conditions in the Philadelphia area remained in expansion territory for the fourth straight month. The Philadelphia Fed index slipped to 7.6 in November from 9.7 in October, though remained above the zero level separating expansion from contraction. Analysts anticipated a slightly narrower easing to a reading of 8.

Cisco (CSCO) slid after issuing weak guidance for its second quarter. The company anticipates current-quarter adjusted earnings of 55 cents to 57 cents a share and for revenue to dip 2% to 4%. Analysts anticipated earnings of 59 cents. Cisco topped first-quarter profit estimates, earning an adjusted 61 cents a share, 2 cents above expectations.

Cisco is a holding in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer buys or sells CSCO? Learn more now.

Walmart ( WMT) fell after the world's largest retailer earned 98 cents a share in the third quarter on $118.2 billion in revenue. Consensus was for 96 cents a share on $118.6 billion. Same-store sales increased 1.2%. Walmart also updated its full-year earnings outlook to $4.20 to $4.35 a share, upping the lower-end of its range from $4.15.
Staples ( SPLS) reported a drop in profit and revenue over its third quarter as same-store sales declined at a faster-than-expected pace. The stationery retailer saw same-store sales decline by 4% over the quarter, sharper than a 3.6% drop. Excluding store closures and foreign exchange fluctuations, overall revenue declined 2%. Current-quarter adjusted earnings estimates of 23 cents to 26 cents a share also came in on the weak side.

Best Buy (BBY) surged after topping third-quarter estimates. Adjusted earnings of 62 cents a share breezed past consensus of 47 cents. Sales increased 1.4% to $8.95 billion and exceeded estimates of $8.85 billion. Domestic same-store sales rose 1.8%, above a 1% target. Strength in sales of computing and home theater products drove quarterly growth.

Children's Place (PLCE) jumped 13% after raising its outlook on the back of a solid first quarter. The children's retailer anticipates full-year profit between $4.17 and $4.27 a share, up from a previous range of no higher than $4.10 and better than consensus of $4.09. A better outlook was driven by expanding gross margins, growth in comparable-store sales and a tighter control of expenses.

Valeant Pharmaceuticals (VRX)  recovered from earlier losses by Thursday afternoon. Earlier in the session, federal prosecutors leveled charges against a number of executives involved in kickbacks and fraud. Prosecutors charged Gary Tanner, a former executive at the drugmaker, and Andrew Davenport, former CEO at its pharmacy partner Philidor Rx Services, for their involvement in the scheme.

Microsoft (MSFT) rose 2% after being upgraded to buy from neutral at Goldman Sachs. Analyst Heather Bellini also upped her stock price target to $68 from $60. The rating change was driven by positive outlooks concerning growth in its Azure cloud business.

First Solar (FSLR) fell nearly 5% after detailing plans to cut more than one-quarter of its workforce. The energy company will lay off around 1,600 workers at its facilities both in the U.S. and international operations. The layoffs will results in at least $500 million in charges and lead to a loss for the year.

Western Refining (WNR) rallied 23% after Tesoro (TSO) agreed to purchase the company in a deal worth roughly $4.1 billion. The offer of $37.30 a share represents a 22% premium over Western's closing price on Wednesday.

If you liked this article you might like

What U.S. Tech Giants Stand to Lose -- and Gain -- From a Trade War With China

What U.S. Tech Giants Stand to Lose -- and Gain -- From a Trade War With China

Small-Cap Biotech and Tech Names Part of Our Latest 'Sweet 16' Stock Picks

Small-Cap Biotech and Tech Names Part of Our Latest 'Sweet 16' Stock Picks

Here Are the Biggest Losers Monday From Each Major Index

Here Are the Biggest Losers Monday From Each Major Index

Alibaba Pops on Possible China Listing; Cyber Security Deal Buzz Ramps -- ICYMI

Alibaba Pops on Possible China Listing; Cyber Security Deal Buzz Ramps -- ICYMI

Why Cisco Systems Is Looking Like a Must-Own Stock

Why Cisco Systems Is Looking Like a Must-Own Stock