U.S. stocks closed higher on Wednesday after the Federal Reserve kept rates unchanged in its July statement and the continued recovery in oil prices encouraged investor sentiment. (Tweet This)
"The statement was a little more hawkish than I expected and they talked about progress in the labor market and inflation lagging," said Peter Cardillo, chief market economist at Rockwell Global Capital. "The fact that they gave a slight upgrade to the housing market, etc., leaves the door open for a rate hike in September."
The Federal Reserve kept rates unchanged and gave no hint of liftoff coming in the next meeting. The decision on the rates was unanimous. Policymakers said the economy is expanding moderately and made no mention of recent volatility around Greece or China.
"The Fed wants to normalize rates so they can show the economy is not in crisis... but at the same time they don't want long-term rates to go up too fast," said Alan Rechtschaffen, financial advisor and senior vice president at UBS Wealth Management Americas. He noted that the market may have realized that raising rates does not mean an abrupt end to easy money.
The Dow Jones industrial average closed about 120 points higher. The index traded as much as 146.5 points higher and briefly trimmed gains to trade about 70 points higher following the statement release. The Nasdaq Composite briefly dipped into negative territory before trading half a percent higher.
Stocks held higher ahead of the statement release, with the Dow up about 100 points.
"I certainly view this as a slightly hawkish statement that the Fed added the word 'some' (versus 'further') improvement in the labor market," said Eric Lascelles, chief economist at RBC Global Asset Management. "The market has not been overwhelming in its response. (There's) some focus on oil."
Crude oil settled 81 cents higher at $48.79 a barrel. Earlier, oil briefly traded above $49 a barrel after the weekly crude inventories showed a greater-than-expected decline. Gold settled down $3.60 at $1,092.60 an ounce.
Energy jumped more than 1 percent to lead all 10 sectors in the S&P 500 higher, with the oil and gas drilling sub sector leading gains.
The Federal Open Market Committee concluded its two-day meeting in the afternoon and was scheduled to release its statement at 2:00 p.m. No press conference was planned.
"Once again Janet Yellen pulls off a dovish statement, the market likes it, and (it) doesn't take September off the table," said Doug Cote, chief market strategist at Voya Investment Management.
The 10-year Treasury yield briefly climbed to 2.3 percent before retreating to an earlier level of 2.28 percent. The was 0.70 percent, little changed from earlier levels.
"I think the market will quickly look past this Fed statement and focus on those things it's been looking at—oil prices, commodity prices, and the path China will take in the next couple of months," said Roger Bayston, director of fixed income at Franklin Templeton.
After initially trading flat, the dollar strengthened against major world currencies, with the euro falling below $1.10 and the yen slightly weaker at 123.9 yen against the greenback.
Earlier, the Dow Jones industrial average traded more than 100 points higher, led by gains in Microsoft, Verizon and Boeing. On Wednesday, Microsoft launched its latest operating system, Windows 10, its first free upgrade for some Windows users.
Stocks are higher on the "reversal in commodities, reversal in China, and an earnings season that continues to be reasonably good," Ben Pace, chief investment officer at HPM Partners, said ahead of the statement release. He expected a September rate hike.
"I think for the first time it's been a stock picker's market," he said.
FBR Capital Markets said Tableau delivered a solid June quarter and maintained a "market perform" rating on the stock.
In economic news, pending home sales came in down 1.8 percent in June from May. Housing data so far has been mixed. Last week's new home sales report disappointed analysts while existing home sales jumped to an 8-1/2-year high.
Weekly mortgage applications barely moved for the second week in a row, rising just 0.8 percent, the Mortgage Bankers Association (MBA) said.
After the close Tuesday, Twitter reported earnings that beat on both the top and bottom line. However, user growth figures proved disappointing to investors, sending its shares sharply lower in after-hours trade. The stock closed down 14.5 percent Wednesday.
Gilead Sciences jumped 2.3 percent after it reported adjusted quarterly profit of $3.15 per share, outdistancing estimates of $2.71. Revenue also came in well above Street forecasts, with the drug maker benefiting from increased sales of hepatitis C treatments. Gilead also raised its full-year outlook.
Yelp missed on earnings per share but topped revenue expectations. The consumer review website gave a lower-than-expected forecast for current quarter revenue, amid increasing competition. Shares plunged 25 percent Wednesday.
Express Scripts fell about 1.2 percent after the firm topped earnings estimates and raised its full-years earnings forecast, but missed revenue expectations.
Hilton Worldwide posted earnings that beat estimates on earnings in-line with expectations. The hotel operator also said comparable property revenue per available room—a key hotel industry metric—should rise between 4.5 percent and 6.5 percent for the current quarter. The stock closed up 4.6 percent.
Earlier in the afternoon, the Treasury Department auctioned $35 billion in five-year notes at a high yield of 1.625 percent. Indirect bidders, which include major central banks, were awarded 67.5 percent—the highest on record for that maturity—versus a 10 auction average of 58 percent.
U.S. stocks closed higher on Tuesday, breaking a 5-day losing streak, as energy stocks surged on a recovery in oil prices.
European stocks were higher in the close, with the STOXX Europe 600 up 1 percent.
The Athens stock exchange remains closed and will not likely reopen this week, an exchange spokeswoman told Reuters.
Overseas, mainland Chinese stocks halted a three-day decline with a 3.47 percent gain Wednesday. Analysts remain skeptical of full recovery in the mainland Chinese stock market.
"Any bounceback in China has only occurred because of the supports they put in place," said Randy Frederick, managing director of trading and derivatives at Charles Schwab. "There's still potential for significant pullback in China."
The Dow transports posted its second consecutive day of gains, closing up 1.7 percent.
The closed up 15.31 points, or 0.73 percent, at 2,108.56, with energy leading all 10 sectors higher.
The Nasdaq closed up 22.53 points, or 0.44 percent, at 5,111.73.
The CBOE Volatility Index (VIX), widely considered the best gauge of fear in the market, traded below 13.
About three stocks advanced for every decliner on the New York Stock Exchange, with an exchange volume of 843 million and a composite volume of 3.9 billion in the close.
—CNBC's Peter Schacknow contributed to this report.
On tap this week:
Earnings: Facebook, Samsung, Whole Foods, Barclays, MasterCard, Anthem, General Dynamics, Northrop Grumman, Gannett, Garmin, Nissan, GlaxoSmithKline, Marriott, LaQuinta, Western Digital, Booz Allen Hamilton, Carlyle Group, SolarCity, Shutterfly, Thomson Reuters, WR Grace, Tableau Software, Sonus, Goodyear Tire, American Tower, Total
Earnings: A-B InBev, Procter & Gamble, ConocoPhillips, Delphi Automotive, CME Group, Teva Pharmaceutical, Colgate-Palmolive, Sanofi, Amgen, LinkedIn, Boston Beer, FireEye, Western Union, Brunswick, Stanley Black and Decker, Marathon Petroleum, Starwood, Fiat Chrysler, Mondelez, Deutsche Bank, Diageo
8:30 am: Initial claims
8:30 am: Q2 GDP
Earnings: Exxon Mobil, Chevron, Honda Motors, Seagate Technology, TransCanada, Newell Rubbermaid, Weyerhaeuser, Phillip 66, CBOE Holdings, Legg Mason, ArcelorMittal
8:30 am: Employment cost index
9:45 am: PMI
10:00 am: Consumer sentiment
More From CNBC.com: