She noted that the Fed’s longer-term outlook is less clear. Ms. Yellen’s term as Fed chairwoman ends in February, and Mr. Trump could then replace her.

The Fed, charged with maximizing employment and moderating inflation, is close to achieving both goals. The unemployment rate fell to 4.7 percent in February, consistent with the normal churn of people moving among jobs. And after several years of concern that prices were not rising fast enough, inflation is reviving. The Fed’s preferred measure rose 1.9 percent over the 12 months ending in January, close to its 2 percent annual target.

“The basis for today’s decision is simply our assessment of the progress of the economy,” Ms. Yellen said at the postmeeting news conference. “And it’s been doing nicely.”

The Fed, which had made more inflation a central objective, said on Wednesday that it was now focused on stabilizing inflation. Ms. Yellen took the opportunity to note that inflation may now rise a bit above 2 percent, just as it has been below 2 percent the last few years. “It’s a reminder 2 percent is not a ceiling on inflation,” she said. “It’s a target.”

The Fed’s increased confidence was reflected in a new round of policy forecasts it also published Wednesday. An increased number of Fed officials are expecting to raise rates at least twice more this year. Only three of the 17 officials who submitted forecasts expect the central bank to move more slowly. There was a similar coalescing around tighter policy for the following two years, marking the first time in recent years that the Fed’s quarterly economic forecasts have shifted toward a prediction of tighter monetary policy.

This is the third time the Fed has raised rates since the financial crisis. The first hike came at the end of 2015 and the second almost exactly one year later. This time the Fed waited just three months. The benchmark rate remains below 1 percent, a very low level.

People with credit card debt are likely to see an immediate increase of about a quarter percentage point in their interest rates. The effect on longer-term loans is less direct, but the average rate on a 30-year mortgage rose by half a percentage point over the last year.