By Alonso Soto
BRASILIA (Reuters) - Standard & Poor's cut Brazil's sovereign debt rating closer to speculative territory on Monday in a blow to President Dilma Rousseff, whose efforts to stir the economy from a years-long slump have eroded the country's finances.
Brazil had its long-term debt rating downgraded to BBB minus, the agency's lowest investment-grade rating. S&P changed its outlook to stable from negative, meaning further downgrades are unlikely for now, which will come as a relief for both politicians in Brasilia and financial markets.
The move was widely expected but the timing surprised some investors.
As it came ahead of an October election in which Rousseff will seek a second term, the downgrade will expose her left-leaning government to further accusations that it has squandered the goodwill built during a long economic boom last decade.
Brazil has suffered from slow growth that averaged about 2 percent in recent years. Rousseff has tried to revive the economy with tax cuts and social spending but has been widely criticized for intervening too much and resorting to sometimes opaque accounting moves to meet budget targets.
"The downgrade reflects the combination of fiscal slippage, the prospect that fiscal execution will remain weak amid subdued growth in the coming years, a constrained ability to adjust policy ahead of the October presidential elections, and some weakening in Brazil's external accounts," S&P said.
The agency said that fiscal credibility had been "systematically weakened" following cuts in the government's main budget target, and that loans by state-run banks had "undermined policy credibility and transparency."
The Brazilian finance ministry rejected S&P's arguments and said the downgrade contradicted Brazil's solid economic fundamentals and healthy standing compared with other major economies.
"The Brazilian economy has low external vulnerability because it holds the fifth largest volume of international reserves among G20 nations," it said in a statement.
The short-term effect of the move on financial markets was unclear, analysts said. Some investors could sell Brazilian assets because of policies forcing them to hold higher-quality stocks and bonds, while others may focus on the fact that S&P is unlikely to downgrade Brazil any further.
S&P's move could prompt peers Moody's Investors Service and Fitch Ratings to signal they may follow with a downgrade of their own.
"The natural tendency for markets tomorrow is the fear that there could be a chain reaction and other agencies may do the same," said Ariovaldo Santos, manager of floating-rate assets at H.Commcor in Sao Paulo.
Moody's and Fitch, which still rate Brazil two notches into investment-grade territory, have indicated, however, that they do not intend to downgrade Brazil before the elections.
Rousseff's government has worked to restore its credibility on budget targets in recent months, but investors are worried that she will resort to more unorthodox accounting moves and raise spending as she seeks re-election.
The downgrade is unlikely to undermine Rousseff's popularity among voters, but potential rivals blamed her management of the economy for Brazil's fall from grace on financial markets.
Opposition leader Aécio Neves said the downgrade was due to the "manipulation" of fiscal accounts by her government, "exorbitant" public spending and "leniency" with inflation.
"Brazil is going through a sad moment of loss of confidence and ruined credibility," he said in a statement.
(Additional reporting by Priscila Jordao; Editing by Brian Winter, Kieran Murray, Bernard Orr and Lisa Shumaker)