President Trump put the Federal Reserve at the middle of Wednesday’s stock-market selloff just minutes after the White House issued a statement playing down the drop by pointing to solid economic fundamentals.

“The Fed is making a mistake,” Mr. Trump told reporters in Erie, Pa., after stock markets suffered their biggest decline in more than seven months. “I think the Fed has gone crazy.”

Mr. Trump has for weeks grumbled about the central bank’s campaign to gradually lift short-term rates, which the Fed has been doing to guard against inflation and economic overheating. Wednesday’s comments were the first time he said the Fed had been responsible for inflicting market losses.

Of the stock market, he said, “Actually, it’s a correction that we’ve been waiting for, for a long time. But I really disagree with what the Fed is doing, OK?”

The Fed has raised its benchmark short-term interest rate three times this year, most recently last month by a quarter-percentage-point to a range between 2% and 2.25%. Officials have indicated they expect another percentage point in rate increases will be needed to keep the economy on an even keel through 2019.