By Saqib Iqbal Ahmed and Caroline Valetkevitch
NEW YORK (Reuters) - The U.S. dollar index hit a two-month high and U.S. bond prices fell on Friday after Federal Reserve Chair Janet Yellen said a U.S. interest rate hike will likely be appropriate in the coming months.
Although they briefly trimmed gains on Yellen's remarks, U.S. stocks ended higher and the S&P 500 capped off its strongest week since March. MSCI's all-country world stock index <.MIWD00000PUS> had its best weekly performance since mid-April.
"It's appropriate... 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," Yellen told an audience of Harvard University professors and alumni.
Yellen's comments follow a chorus of policymakers who in recent weeks have talked up expectations that an increase in borrowing costs may be near.
"The market wasn't looking for anything from Yellen. It ended up she said something that was a bit hawkish, especially for her," said Thomas Roth, head of U.S. Treasury trading at Mitsubishi UFJ Securities USA Inc.
Short-dated U.S. bond yields spiked after the comments. The two-year yield (US2YT=RR) was up more than 4 basis points at 0.911 percent, while the five-year (US5YT=RR) gained 4 basis points to 1.386 percent.
In the foreign exchange market, the dollar index (.DXY) rose 0.60 percent to 95.745, the highest level since March 29. It has surged from a low of 91.919 on May 3.
The dollar gained earlier on Friday after U.S. economic growth was revised upward for the first quarter.
While higher interest rates can hurt liquidity in stock markets, many investors see a potential rate hike as a vote of confidence in the U.S. economy.
The Dow Jones industrial average (.DJI) gained 44.93 points, or 0.25 percent, to 17,873.22, the S&P 500 (.SPX) added 8.96 points, or 0.43 percent, to 2,099.06 and the Nasdaq Composite (.IXIC) rose 31.74 points, or 0.65 percent, to 4,933.51.
For the week, the S&P 500 rose 2.3 percent and the Dow added 2.1 percent, the best weekly performance for both since March.
MSCI's all-country world stock index <.MIWD00000PUS> was last up 0.3 percent on the day and 2.3 percent for the week. The pan-European FTSEurofirst 300 index (.FTEU3) of leading regional stocks closed up 0.2 percent.
Trading volume was light in most markets ahead of public holidays that will close London and New York markets on Monday.
Oil prices dipped for a second day in a row, with investors taking profits after a surge to seven-month highs above $50 a barrel this week.
Brent crude (LCOc1) fell 27 cents to settle at $49.32. It rose to $50.51 in the previous session, its highest since early November. U.S. crude (CLc1) dipped 15 cents to settle at $49.33. It hit its October high of $50.21 on Thursday.
"People are worried crude production will come roaring back at these prices," said Phil Flynn, energy markets analyst at the Price Futures Group in Chicago.
Gold slid to an eight-week low amid the U.S. rate hike speculation. Spot gold (XAU=) was down 0.3 percent at $1,215.39 an ounce.
(Additional reporting by Barani Krishnan and Richard Leong in New York; Editing by Nick Zieminski and Dan Grebler)