Federal Reserve Chairwoman Janet Yellen said Friday a rate increase would be appropriate “probably in the coming months” if the economy and labor market continue to strengthen.

“It’s appropriate, and I’ve said this in the past I think, for the Fed to gradually and cautiously increase our overnight interest rate over time, and probably in the coming months such a move would be appropriate,” she said during a panel discussion at the Radcliffe Institute for Advanced Study at Harvard University.

Ms. Yellen’s comments echoed those of her colleagues on the Fed’s rate-setting committee, several of whom have said in recent days they foresee two or three rate increases this year, with the next increase possible as soon as the Fed’s next meeting June 14-15.

Ms. Yellen didn’t point to a particular meeting, but her comments will give an additional boost to expectations that the Fed is getting closer to another policy move.

U.S. stocks pared some of Friday’s gains after Ms. Yellen’s remarks, with the Dow Jones Industrial Average recently up 13 points to 17841 and the S&P 500 up 0.2%. The dollar extended gains after her comments. The WSJ Dollar Index was up about 0.5% in recent trading, compared with a gain of 0.3% before Ms. Yellen’s talk.

Still, the Fed leader emphasized the path of rate increases likely will remain gradual, because raising rates too quickly could trigger a downturn to which the Fed may have limited tools to respond.

Ms. Yellen said the economy is continuing to improve, with the unemployment rate close to what many economists associate with “full employment” and signs of economic activity firming.

“We saw weak growth in the first quarter of the year, and relatively weak growth at the end of last year,” she said. “The growth looks to be picking up from the various data that we monitor.”

While oil prices and the dollar stabilize, Federal Reserve Chairwoman Janet Yellen said Friday inflation rates will raise in the next couple of years if labor markets continue to improve. Photo: AP

The Commerce Department said Friday that gross domestic product, a broad measure of goods and services produced across the economy, expanded at a 0.8% seasonally adjusted annual rate in the first quarter, better than initially thought.

This follows a string of robust economic data in recent weeks, including strong reports on retail sales, trade and durable goods orders that had led analysts to boost their estimates for second-quarter growth. The Fed set at its April meeting a lift in output growth as one of its criteria for raising rates, and the latest data seem to be delivering the expected lift.

The New York Fed on Friday raised its estimate for second-quarter growth for the third week in a row, to 2.2%. And the Atlanta Fed lifted its estimated Thursday to 2.9%, from 2.5% the week before.

Ms. Yellen said the labor market “on almost any metric” had improved over the past year, though she noted officials haven’t seen much of an increase in wage growth, suggesting some slack remains in the jobs market.

Low oil prices and the strength of the dollar had held back headline inflation, but those factors seem to have stabilized, Ms. Yellen said. If they remain stable and the labor market continues to improve, inflation is likely to rise toward the Fed’s 2% target over the next couple of years, she said.

She also warned that output has been “remarkably slow” despite strong job gains. That has led to productivity growth averaging only half a percentage point a year over the past five years, which she called “a really very miserable pace.”

“Since productivity growth ultimately determines the pace of improvement in living standards for society as a whole, that’s a serious and negative development,” she said.

Fed officials earlier this year warned that global economic and financial uncertainty posed risks to the U.S. economy and justified a slower path of rate increases. When Fed officials met at the end of April, however, many of them said they believed those risks had receded and thought the Fed should keep its options open for a rate increase in June, according to minutes from the meeting. They also sought to push back against low market expectations for a summer rate rise.

One possible impediment to a June rate increase is the referendum in the U.K. on whether to leave the European Union. Several Fed officials have flagged the so-called Brexit vote—set for the week after the Fed’s June meeting—as a source of uncertainty that could cause them to hold off on another rate rise until later this summer.

Ms. Yellen wasn’t asked about the risks from a Brexit vote during her appearance Friday. She is scheduled to speak again on June 6 in Philadelphia.

The Fed raised its benchmark federal-funds rate in December to a range between 0.25% and 0.50%, after leaving it near zero for seven years. At the time, officials projected they would raise rates by a full percentage point this year, but officials cut that estimate in half at their March meeting.

Ms. Yellen was speaking at an event honoring her with the Radcliffe Medal, an annual award the institution presents “to an individual who has had a transformative impact on society.” Past recipients include Supreme Court Justice Ruth Bader Ginsburg, feminist organizer Gloria Steinem and tennis champion Billie Jean King.

In remarks before the medal was awarded, Ms. Yellen’s immediate predecessor, Ben Bernanke, praised the Fed chairwoman as “an outstanding policy maker and an outstanding person.”

“She was consistently prescient about the peril that an imploding financial system posed for the economy, as well as about the risk that the economic recovery could be very slow and protracted,” he said.

He also recalled when Ms. Yellen came to him for advice when she was being considered for the central bank’s top job.

“I think Janet well understood that by taking this position and applying her considerable talents, she could provide a valuable role model for future generations of young women who might not otherwise engage with economics or economic policy-making,” he said. “That is in itself a great contribution on top of all the others she’s made.”

The New York Times attends Radcliffe Day and the coverage highlights the morning panel on the economy and Radcliffe Medalist Janet Yellen's remarks and what they may mean for interest rates in the months ahead.

Harvard Magazine says of Radcliffe Medalist Federal Reserve Chair, "Yellen has been unapologetic in her view that restraining inequality is inherent in the Fed’s mandate, a role which has cemented her leadership in the public conversation on inequality."

Harvard Magazine says of the Radcliffe Day 2016 panel, Building an Economy for Prosperity and Equality, "featured some of the most interesting researchers addressing these problems as participants in a searching, intelligent exchange of the sort that rarely occurred in the debates televised during the primary season."

Reuters joins more than 1300 attendees at Radcliffe Day at which Federal Reserve Chair Janet Yellen was the honoree. Article features quotations from Chair Yellen and the impact on the markets of what she said.