Doves cheered on Wednesday after the Federal Reserve recommitted to a gradual rate-hike timeline. 

Benchmark indexes had battled to turn positive for much of the session until the central bank's meeting concluded. Trading was erratic as investors processed the news but all indexes managed to close higher. The S&P 500 was up 0.56%, the Dow Jones Industrial Average rose 0.43%, and the Nasdaq gained 0.75%.

The Fed will continue to pursue gradual tightening, Chair Janet Yellen said in a press conference following the central bank's two-day meeting that ended Wednesday. The Fed held rates unchanged, a move Yellen described as "prudent." Only one hawk, Kansas City Fed President Esther George, voted to raise rates.

The central bank now expects two rate hikes this year, down from December's forecast of as many as four. The Fed also cut its forecasts for next year's hikes by 50 basis points.

"The market started to anticipate this and so it's just confirmation that the Fed is realizing that the landscape looks a little differently today than it did in December when they started this process of normalizing," said David Jilek, chief investment strategist at Gateway Investment Advisers. 

Yellen "seems to be reinforcing the idea that the situation is more fluid," he added. "She wants to make it clear to the market that the dot plot graph that has been the focus of a lot folks' commentary over the last few months is not a projection or a plan. It's just an estimate, so is subject to change."

The central bank upgraded its assessment of the U.S. economy, particularly inflation. Members expects full-year GDP growth of 2.2%, down from the 2.4% previously forecast. However, members also upgraded their concern over global economic developments.

Crude oil enjoyed a big rally on Wednesday after the Energy Information Administration reported a 1.3-million-barrel increase in inventories over the past week, far below estimates of 2.7 million barrels.

Oil was already higher on hopes members of the Organization of Petroleum Exporting Countries can agree upon a production freeze at an April meeting. Members will meet in Qatar on April 17 without Iran in attendance. Iran had previously said it wouldn't commit to a freeze as it works to ramp up production to pre-sanction levels.

West Texas Intermediate crude oil jumped 4% to $37.80 a barrel on Wednesday after closing at its lowest level since March 4 a day earlier.

It was a busy day on the economic calendar. Industrial activity in the U.S. contracted at a faster-than-expected pace in February as utility and mining output slumped. However, manufacturing activity did show a second month of improvement.

"With energy prices beginning to drift higher, the recession in the mining sector may be nearing an end," said Millan Mulraine, deputy chief U.S. macro strategist at TD Securities. "All things considered, the overall outlook for the U.S. industrial sector is beginning to look a little better."

Consumer inflation remained under pressure as energy weighed on the headline number. Consumer prices dropped 0.2% in February, the third straight decline. Excluding food and energy, core consumer prices rose 0.3%.

"With oil and gasoline prices turning around through the first half of March... the drag from energy will be difficult to duplicate next month," Wells Fargo analysts wrote in a note. "In addition, food prices are also beginning to offer a lift to headline inflation."

The housing market continued to show strength with new construction on single-family homes reaching the highest level since November 2007. Housing starts jumped 5.2% to a rate of 1.18 million in February, while permits rose 3.1% to a rate of 1.7 million.

London Stock Exchange Group (LNSTY) and Deutsche Boerse (DBOEY) finalized an all-share merger agreement which will create Europe's largest securities operator. The new company will be named UK TopCo and will be 54.4% owned by shareholders of the German partner. Deutsche Boerse CEO Carsten Kengeter will lead the $30 billion merged company.

SunEdison (SUNE)  was flat, following an earlier drop of 17% after announcing it will delay the release of its 2015 annual report. The solar company said it is still finalizing its 10-K filing after an internal investigation found issues with its accounting processes.

LinkedIn (LNKD) fell 5% after Morgan Stanley downgraded the stock to equal weight from overweight and lowered its price target to $125 from $190. The firm said the company will see "slowing enterprise and online talent solutions growth" and lower earnings on higher development investment.

Chipotle (CMG - Get Report)  dropped 0.53% on reports it will walk back some of its food-safety changes after new food-poisoning cases. The burrito chain said it suffered a 26.1% drop in February sales compared with a decline of 36.4% in January. The company has seen a slight turnaround since Feb. 8 when it began to distribute coupons for free meals.

Oracle (ORCL - Get Report) climbed 3.8% after beating analysts' earnings estimates. The tech giant earned 64 cents a share in its third quarter, 2 cents above estimates. The company also boosted its share buyback program by $10 billion.