By Sinead Carew

NEW YORK (Reuters) - Wall Street stock indexes and the U.S. dollar both posted gains for the week on Friday after Federal Reserve Chair Janet Yellen confirmed market expectations for an interest rate rise in March but profit taking saw equities and the greenback slip for the day.

After regional Fed officials during the week mostly signaled the likelihood of a second policy rate rise in the past three months, in a speech on Friday Yellen confirmed the view that rates may rise at the next Fed meeting on March 14-15 barring any sharp deterioration in economic conditions.

The implied probability of a March rate hike surged to almost 80 percent from 77.5 percent the previous day, according to CME Group's FedWatch tool.

"She's telegraphed that March is not 'live' anymore, it is 'alive,'" said Quincy Krosby, market strategist, Prudential Financial, in Newark, New Jersey. "Financial conditions are supportive of a rate hike, and the Fed has been criticized in the past for not raising rates when financial conditions were supportive."

The S&P 500 and Nasdaq posted their sixth consecutive week of gains this week. Interest rate sensitive sectors such as real estate and utilities were among the decliners while financial stocks rose because rising rates tend to boost bank profits.

The Dow Jones Industrial Average <.DJI> rose 2.74 points, or 0.01 percent, to 21,005.71, the S&P 500 <.SPX> gained 1.2 points, or 0.05 percent, to end at 2,383.12 while the Nasdaq Composite <.IXIC> added 9.53 points, or 0.16 percent, to reach 5,870.75. The MSCI global stock index <.MIWD00000PUS> rose 0.1 percent for a record closing high.

European shares posted their best weekly gains of 2017, although they were down on the day following disappointing company updates.

The pan-European STOXX 600 <.STOXX> ended the day 0.1 percent lower after touching a 15-month high in the previous session and ended up 1.4 percent for the week.

The MSCI global stock index <.MIWD00000PUS> was down 0.5 percent for the day but up 0.25 percent for the week.

U.S. Treasury yields rose, with 2-year notes touching a fresh 7-1/2-year high and other maturities hit multiweek peaks after Yellen's speech.

Benchmark 10-year <US10YT=RR> yields rose to 2.507 percent, while yields on 7-year notes <US7YT=RR> rose to 2.347 percent. Both reached their highest levels since Feb. 15.

"The writing has been on the wall for the past couple of days," said Karyn Cavanaugh, senior market strategist at Voya Investment Management in New York.

Benchmark yields ended up by 18 basis points for the week, their largest one-week increase since Nov. 18.

The U.S. dollar index <.DXY> fell 0.8 percent against a basket of six major currencies as investors took profits but it was still on track for its fourth straight weekly gain.

"There's a lot of positive news now priced into the market, and I think we'll probably see some profit-taking, so I think we'll probably see the dollar weaken from here," said Douglas Borthwick, managing director at Chapdelaine Foreign Exchange in New York.

The Mexican peso rallied to its strongest level since the U.S. election last November after U.S. Secretary of Commerce Wilbur Ross said a new mechanism should be created to stabilize the exchange rate.

In commodities, crude oil futures rose as the weaker U.S. dollar encouraged buying, but investors remained cautious after Russian production figures showed weak compliance with an agreement to cut output.

Benchmark Brent crude futures <LCOc1> ended the session up 1.5 percent at $55.90 a barrel and WTI futures <CLc1> settled up 1.4 percent, at $53.33 after both closed down about 2.3 percent in the previous day's session.

(Additional reporting by Caroline Valetkevitch, Dion Rabouin, Rodrigo Campos, and Saqib Iqbal Ahmed in New York, Vikram Subhedar in London, Dhara Ranasighe and Wayne Cole in SYDNEY; editing by Nick Zieminski and Clive McKeef)