(Adds central bank comments, background)
MEXICO CITY, March 30 (Reuters) - Mexico's central bank raised its benchmark interest rate for the fifth time in a row on Thursday, taking borrowing costs to an eight-year high but policymakers slowed the pace of hikes on the back of a rally in the peso.
The board of the Banco de Mexico unanimously decided to raise its main rate by a quarter percentage point to 6.50 percent, the bank said in a statement, as expected by 15 of 24 analysts surveyed by Reuters.
The central bank said it raised rates to anchor inflation expectations and that it also took into account the U.S. Federal Reserve's move this month to raise borrowing costs by a quarter-percentage point.
Mexico had hiked in 50-basis point moves in its previous four meetings as the peso tumbled to successive historic lows and threatened to fan inflation.
But the peso has rallied back on bets that U.S. President Donald Trump will not impose big tariffs on Mexican exports to the United States and as initial talks about trade have taken a more positive tone.
The central bank warned in its statement on Thursday that "uncertainty prevails in the external environment" despite the peso's rally, but it did say that the outlook for inflation had not worsened further since its last meeting in early February
Policymakers also said the outlook for growth had improved slightly.
The country's benchmark rate is at levels not seen since early 2009, when the bank was slashing borrowing costs amid a global financial crisis.
Mexico's annual inflation rate rose above 5 percent to a nearly eight-year high in early March, but policymakers said on Thursday that it should trend back toward their 3-percent target by the end of next year.
The peso briefly extended gains after the decision to touch its strongest level in nearly five months, when it was hammered by Trump's surprise election victory.
The peso has gained about 10 percent since the central bank's last decision on Feb. 9. (Reporting by Michael O'Boyle; Editing by Bill Rigby and Alistair Bell)