U.S. stocks whipsawed on Wednesday after the Federal Reserve upgraded its economic outlook and increased interest rates. The central bank also increased its rate-hike forecast for next year.

The Dow Jones industrial average closed 44.96 points lower at 24,682.31, with Apple as the biggest decliner in the index. The Dow rose as much as 250.38 points during the session. The slipped 0.2 percent to 2,711.93 as consumer staples declined 1.3 percent. At its session high, the broad index had risen 0.8 percent. The Nasdaq composite fell 0.3 percent to 7,345.29 after gaining as much as 0.6 percent.

Stocks hit session highs shortly after the Fed made its monetary-policy announcement.

"The initial reaction in stock was because the median dot plot didn't go up for 2018," said James Athey, senior investment manager at Aberdeen Standard Investments. "Then there was the more concerned reaction, with investors saying: 'Hold on, there's one more rate hike in for 2019.'"

The Fed raised overnight rates by 25 basis points, in line with market expectations. Central bank officials also raised their GDP forecast.

"The economic outlook has strengthened in recent months," the committee said in its post-meeting statement, a sentence that had not been in previous releases. "Job gains have been strong in recent months, and the unemployment rate has stayed low."