The Fed raised interest rates on Wednesday for the second time in three months and said it would begin cutting its holdings of bonds and other securities this year, signaling its confidence in a growing U.S. economy and strengthening job market, Reuters reported.

In lifting its benchmark lending rate by a quarter percentage point to a target range of 1.00 percent to 1.25 percent and forecasting one more hike this year, the Fed seemed to largely brush off a recent run of mixed economic data.

The U.S. central bank's rate-setting committee said the economy had continued to strengthen, job gains remained solid and indicated it viewed a recent softness in inflation as largely transitory.

Meanwhile, the Yale University economics professor explained that a big risk could be a decline in the prices of 10-year Treasury notes.

Shiller warned that it wouldn't be good for Treasurys if the federal-funds rate moves up to 3 percent over the next two years. (The federal-funds rate is the interest rate at which depository institutions (banks and credit unions) lend reserve balances to other depository institutions overnight, on an uncollateralized basis.)

"We may see a decline in the prices of those bonds," he warned. "Three percent is well above the current 10-year Treasury yield. ... I wouldn't want to pull out of stocks."

Even though Shiller believes investors should keep buying stocks here at home and aboard, he acknowledges that a recession could still come at any time, CNBC.com explained.

"You know recessions always come as a surprise," said Shiller. "An inverted yield curve is supposed to be a sign of a recession. We don't have an inverted yield curve now. We don't see any signs, but it could certainly happen."

The Fed has now raised rates four times as part of a normalization of monetary policy that began in December 2015. The central bank had pushed rates to near zero in response to the financial crisis.

Fed policymakers also released their latest set of quarterly economic forecasts, which showed only temporary concern about inflation and continued confidence about economic growth in the coming years.

They forecast U.S. economic growth of 2.2 percent in 2017, an increase from the previous projection in March. Inflation was expected to be at 1.7 percent by the end of this year, down from the 1.9 percent previously forecast.

A retreat in inflation over the past two months has caused jitters that the shortfall, if sustained, could alter the pace of future rate hikes. But the Fed maintained its forecast for three rate hikes next year.

The Fed's preferred measure of underlying inflation has retreated to 1.5 percent, from 1.8 percent earlier this year, and has run below the central bank's 2 percent target for more than five years.