Brazilian equities wrapped up their second weekly decline, driving the Ibovespa benchmark closer to a bear market as Latin America’s biggest economy faces its worst recession in a quarter-century.

Stocks also slumped amid concern the country will lose its investment-grade credit rating and as a corruption scandal that started at the state oil producer adds to instability. Nationwide protests are planned for Sunday as President Dilma Rousseff fights for her political survival, and a devaluation in China this week is weighing on prospects for exporters including the miner Vale SA.

“There are so many reasons to believe that the market won’t get any breathing room,” Raphael Figueredo, an analyst at brokerage Clear Corretora, said by telephone from Sao Paulo. “There’s still a bit of of overhang from markets outside Brazil — concern over China.”

The Ibovespa slid for a fourth straight day, declining 1 percent to 47,508.41 at the close of trading in Sao Paulo. It extended its drop from its 2015 high on May 5 to 18 percent, with a decrease of 20 percent indicating a bear market. Forty-eight of the Ibovespa’s 66 stocks fell Friday as meat exporter JBS SA contributed the most to the decline in the benchmark equity index.

-1x-1

Brazilian stocks joined a global selloff this week after China devalued the yuan as policy makers stepped up efforts to combat the deepest slowdown since 1990 and support local exporters. Vale, which gets a third of its revenue from China, fell 1.9 percent and extended this year’s plunge to 25 percent. JBS dropped 4 percent as second-quarter profit slumped on currency-hedging costs.

The airline Gol Linhas Aereas Inteligentes SA sank 7.4 percent to the lowest level since its 2004 initial public offering after Chief Executive Officer Paulo Sergio Kakinoff said on a conference call that the economic backdrop is the worst he has ever seen. State-controlled oil producer Petroleo Brasileiro SA lost 2.2 percent.