The S&P 500 erased its losses for the year Friday, joining the Dow industrials in positive territory as major indexes notched their fifth straight week of gains.

The week’s advance accelerated after the Federal Reserve on Wednesday signaled a more gradual path of interest-rate increases. The Dow Jones Industrial Average, which has risen for six sessions in a row, gained 2.3% this week. The S&P 500 added 1.4%.

Government bonds also rallied this week, spurred by the Fed’s hesitance to lift rates. The yield on the 10-year Treasury note posted its first weekly decline in five weeks and the yield on two-year Treasurys logged its biggest weekly decline since October. Bond yields move inversely to bond prices.

The Dow and the S&P 500 have risen roughly 12% from their lows on Feb. 11, as oil prices recovered and economic data showing that the U.S. continues to expand helped calm fears of a recession.

“We don’t think [gains] are going to be nearly as dramatic from here,” said Steve Weeple, who oversees about $6 billion as a global portfolio manager at Standard Life Investments. “The reversal was pretty fast,” he said.