"After months of talking tough on rates it appears that Janet Yellen has changed her tune. My belief is that the original hawkishness was contingent on a belief that pro growth policy changes were right around the corner," Jim Iurio, managing director of TJM Institutional Services, said in an email.
"However, this takes away one of stock markets primary worries, that the Fed would raise rates before the political landscape could be sorted out. In other words, this is a long way of saying the Fed's got your back," he said.
Yellen delivered her remarks in front of Congress on Wednesday. She also answered questions about monetary policy and the health of the U.S. economy.
Treasury yields fell after Yellen's testimony was released. The benchmark 10-year note yield traded at 2.32 percent, down from 2.35 percent earlier. The two-year yield, which is more sensitive to monetary-policy changes, fell from 1.38 percent to 1.34 percent.
"There seems to be a resurgence of the tug-of-war within the Fed regarding the rates trajectory," said Quincy Krosby, chief market strategist at Prudential Financial. "At here [June] press conference, she indicated that the bar to keep rates lower for longer was higher. Now it seems like that may change."
The Fed raised rates last month for the second time this year. The central bank also released details about how it plans to unwind the balance sheet.
"I think she knows she's not going to be in her job as of February of next year, so she want's to normalize rates" as much as possible, said Aaron Anderson, head of research at Fisher Investments.
The Fed also released its latest edition of the Beige Book, which summarizes the central bank's thoughts on current economic conditions. In it, it said it sees the U.S. economy growing at a "slight to moderate" pace.
Elsewhere, gold futures for August delivery gained $4.40 to settle at $1,219.60 per ounce.
About four stocks advanced for every decliner on the New York Stock Exchange, with an exchange volume of 458.30 million and a composite volume of 2.205 billion in afternoon trade.