U.S. stocks closed at highs on Tuesday as Fed Chair Janet Yellen's congressional testimony indicated that a rate hike would likely come later rather than sooner.
The testimony has "certainly got something for everyone on the market today. It's right down in the middle of the fairway and leaves the window open for a June or September (rate hike)," said Art Hogan, chief market strategist at Wunderlich Securities.
Stocks climbed to new records amid Yellen's remarks to the Senate Banking, Housing and Urban Affairs Committee on Tuesday. She will address the House Financial Services Committee on Wednesday.
Read MoreJanet Yellen: Don't audit the Fed
The Dow Jones industrial average briefly gained more than 100 points to set a new intraday record of 18,231.09, led by 4 percent gains on Home Depot.
The S&P 500 advanced to touch a new intraday high at 2,117.99.The Nasdaq closed positive at 15-year highs for its 10th consecutive day of gains.
"Almost every day markets are driven by central bank policy, whether it's the Fed, the ECB, Bank of Japan," said Peter Boockvar, chief market analyst at The Lindsey Group. "Economic fundamentals have not been dragging markets down. It's another day of 'Yellen is noncommittal, therefore buy stocks.'"
Yellen's prepared remarks said no rate hike is expected for the next few FOMC meetings. She later said in a question-and-answer session that the Fed would not raise rates before it found confidence in the economic recovery, overcoming current concerns about the labor market, below-objective inflation and the decline in energy prices.
"Once again, Ms. Yellen seems to be trying extremely hard to persuade investors and market participants that, while an inevitable increase in interest rates is likely to happen, when it does it should not take anyone by surprise. In addition, when the Fed moves, it will not be substantial," Andrew Wilkinson, chief market analyst at Interactive Brokers, said in a note.
Eric Stein, portfolio manager in the Global Income Group at Eaton Vance, said the Fed chair's remarks were "in-line to a little hawkish."
"I think June is still very much in play but it's all going to be very data dependent," he said, noting that the labor market will need to show continued strength in order for a rate hike to come in the second half of this year.
The Fed funds futures indicated that the first meeting with a better-than-average chance of a rate hike is October, after the chance for a rate hike in September fell to 48 percent from 50 percent earlier today, according to CME Group data.
Short-term yields spiked following the statement's release. The 10-year Treasury yield initially held steady near 2.08 percent before falling to below 2.00 percent after the conclusion of Yellen's Senate testimony.