The economy is in good shape for the near future, Federal Reserve Chairman Jerome Powell said Tuesday, testifying that "the job market will remain strong and inflation will stay near 2 percent over the next several years."

Powell provided that sunny forecast in an appearance before the Senate Banking Committee, adding that the favorable combination of low unemployment and stable inflation was dependent on good monetary policy from the central bank.

"For now — the best way forward is to keep gradually raising" interest rates, he said.

The economy does face threats, Powell acknowledged, including from the possibility of a trade war.

Nevertheless, he said that the Fed believes that the economy is about as likely to boom beyond expectations as it is to tip into recession.

Investors expect the Fed to continue slowly raising its interest rate target, with two more quarter-percentage point hikes this year.

Powell reassured senators Tuesday that steady rate increases was the Fed's preferred course of action, noting that tightening monetary policy too slowly could raise the risk of too-high inflation or financial market bubbles.