Stocks rose on Wednesday, bolstering their gains for the month, after the Federal Reserve opened the door for looser monetary policy in the near future.

The Dow Jones Industrial Average rose 38.46 points to 26,504, while the S&P 500 gained 0.3% to close at 2,926.46. The Nasdaq Composite advanced 0.4% to 7,987.32.

The Fed kept interest rates unchanged at the meeting, as was widely expected. While not outright signaling a cut was ahead this year, the Fed did drop the word "patient" from its statement and said it would "act as appropriate" to sustain the economy.

The central bank's rate projections, released alongside the statement on Wednesday, showed that eight Fed members see a cut this year, which traders took as further sign the central bank was close to cutting rates. Its median forecast, however, still reflected no cuts this year, but additional easing in 2020.

Fed Chair Jerome Powell also said in a news conference after the announcement that some Fed officials believed the case for easier monetary policy had strengthened.

Health care stocks, which typically perform well after the Fed cuts rates, were the best performers on Wednesday. The sector rose 1%, led by gains in Allergan and DaVita.

"This was our baseline scenario. The Fed opened the door for cuts. They maintained some independence from some of the outreach for lower rates coming out of the administration," said Gregory Faranello, head of U.S. rates at AmeriVet Securities. "Short term, it's going to depend on the data. If the data warrants a cut, the chairman is saying the Fed is prepared to adjust policy."

Treasury yields fell following the announcement, pressuring bank shares. The benchmark 10-year yield traded down at 2.02%. Citigroup, Morgan Stanley, J.P. Morgan Chase and Bank of America all traded lower.

Traders are pricing in easier monetary policy as soon as July. They were also betting on rate cuts coming in September and December, according to the CME Group's FedWatch tool.