NEW YORK (Reuters) - Financial stocks lifted the S&P 500 to a record closing high for a fourth consecutive session on Tuesday and the dollar strengthened as U.S. Federal Reserve Chair Janet Yellen struck a hawkish tone on the timing of an interest rate hike.

Slideshow ( 2 images )

Yellen told the U.S. Senate Banking Committee the central bank will likely need to raise interest rates at an upcoming meeting, although she expressed caution about the considerable economic policy uncertainty under the Trump administration.

Financial stocks .SPSY moved higher following her remarks and closed up 1.2 percent as the best performing sector of the S&P 500. Utilities .SPLRCU and real estate .SPLRCR, which tend to weaken in a rising rate environment, ended down 0.7 percent and 0.5 percent, respectively.

The Fed signaled in December that it expected to raise rates three times in 2017.

The dollar reversed course after Yellen's comments and was up 0.3 percent after touching a three-week high of 101.38 against a basket of major currencies .DXY.

“It’s actually a very wise move to try to get the rate hikes going sooner rather than later to cut off the potential for inflation, although I really don’t see inflation picking up all that much over the next year or so,” said Peter Tuz, president of Chase Investment Counsel in Charlottesville, Virginia.

Thomson Reuters data shows traders see a 17.7 percent chance of a 25-basis-point hike in rates at the Fed’s March meeting.

The greenback was initially under pressure following the resignation of President Donald Trump’s national security adviser, Michael Flynn, over revelations he had discussed U.S. sanctions against Moscow with the Russian ambassador to the United States before Trump took office.

Yellen’s hawkish tone dovetailed with recent comments from other Fed officials.

Dallas Fed President Robert Kaplan on Monday argued the Fed should move soon to avoid falling behind the curve, especially as fiscal policy could drive faster growth and inflation. Earlier on Tuesday, Richmond Fed President Jeffrey Lacker said the central bank will likely have to raise interest rates more rapidly than financial markets currently expect.

The Dow Jones Industrial Average .DJI rose 92.25 points, or 0.45 percent, to 20,504.41, the S&P 500 .SPX gained 9.33 points, or 0.40 percent, to 2,337.58 and the Nasdaq Composite .IXIC added 18.62 points, or 0.32 percent, to 5,782.57.

Along with the S&P, the Dow notched its fourth straight record, while the Nasdaq closed at a high for a sixth consecutive day.

MSCI's all-country world index .MIWD00000PUS edged up 0.08 percent. Europe's broad FTSEurofirst 300 index .FTEU3 slipped 0.04 percent to snap a five-session winning streak.

Yields on benchmark U.S. 10-year Treasury notes US10YT=RR climbed to 2.4734 percent, down 11/32 in price, after hitting a high of 2.502 percent.

Oil pared earlier gains, settling slightly higher as concerns about rising supply from U.S. shale output overshadowed an OPEC-led effort to cut global output, which has supported oil prices in a higher range. Brent crude LCOc1 settled up 0.7 percent at $55.97 and U.S. crude settled 0.5 percent higher at $53.20 a barrel.