The Dow rose about 80 points, the S&P 500 rose about 11 points, and Nasdaq rose about 31 points. At closing, stocks were near session highs.
David Karp / AP
Stocks ended near the highs of the session, reversing a three-day losing streak as commodity prices rebounded.
The Dow Jones Industrial Average gained 80.60 points, or 0.65 percent, to close at 12,560.18.
Hewlett-Packard led Dow laggards for a second day after the tech giant posted disappointing earnings results on Tuesday and received a downgrade from JPMorgan to "neutral" from "overweight." The brokerage also cut the PC maker's price target to $42 a share from $55, saying HP's revised outlook for the fiscal third quarter and the full year is a "major disappointment." In addition, at least four other brokerages also cut their price targets on the firm.
The S&P 500 rose 11.70 points, or 0.9 percent, to close at 1,340.68, while the tech-heavy Nasdaq rose 31.79 points, or 1.14 percent, to close at 2,815.00. The CBOE Volatility Index, widely considered the best gauge of fear in the market, fell to nearly 16.
Among key S&P 500 sectors, materials and energy gained, while utilities fell, in a reversal of a trend seen over the last couple sessions.
The market got a lift on Wednesday from the dollar, which traded lower most of the session, and the fact "the negativity in the market is taking a little bit of a breather," said Quincy Krosby, market strategist at Prudential Financial.
Another factor is the expiration of stock index futures and options on Friday, Krosby said. "That really does tend to skew the markets a few days before," she said.
On Wednesdsay, the Fed released policy minutes from its April meeting that outlined the central bank's thinking about how to tighten monetary policy when the time comes.
Most Fed officials prefer to tighten policy through interest rate hikes rather than asset sales, according to the minutes of the Federal Reserve's policy setting meeting, which were released on Wednesday.
The central bank indicated they would eventually cut the Fed's portfolio, and that selling mortgage-related debt would be a priority, Reuters reported, describing the discussions of an exit strategy as "intense."
Oil prices rebounded after a surprise drop in gasoline inventories, followed by an unexpected fall in crude supplies, the Energy Information Administration reported Wednesday. U.S. light, sweet crude rose 3.29 percent to settle at $100.10 a barrel, while in London, Brent crude rose 2.1 percent to close at $112.30.
The dollar traded flat against a basket of currencies, after trading lower earlier in the session. Precious metals prices gained, as gold settled up 1 percent to $1,495.60 an ounce, while silver settled up 4.8 percent at $35.09 an ounce.