By Paulo Trevisani 

BRASÍLIA--Standard & Poor's Ratings Services on Tuesday downgraded its outlook for Brazil's sovereign debt, saying the government will have to show firmer resolve to tackle the country's fiscal woes if it hopes to maintain the nation's investment-grade credit rating.

S&P cut the outlook for Brazil's foreign-currency debt to negative from stable, while keeping the rating at BBB-, its lowest investment-grade level. Just four months ago, the agency had reaffirmed a stable outlook, but economic and political conditions have deteriorated quickly since then.

Since March "risks have tilted to the down side," said S&P's primary analyst for Brazil, Lisa Schineller, in a conference call. A deeper-than-expected economic slowdown and congressional resistance to fiscal-austerity measures have made it more challenging to reduce the country's heavy debt burden, which stands at 62.5% of GDP, a level considered by many analysts to be too high for investment-grade status.

A Finance Ministry spokeswoman had no immediate comment.

Another rating cut by S&P would move Brazil to junk status, likely increasing borrowing costs and prompting risk-averse investors to dump their holdings of Brazilian debt.

The outlook review spooked markets already concerned that Brazil could be downgraded to junk level. The Brazilian real reached 3.43 per dollar, a level not seen in 12 years, before gaining some ground and closing at 3.38 per dollar.

The other two major credit-ratings firms, Moody's and Fitch, both rate the country's bonds two notches into investment grade, also with a negative outlook.

Recently, a local, small rating agency called Austin Rating cut the sovereign debt to junk status.

S&P officials said that, despite positive changes in economic policy earlier this year, a tense political climate has lowered the odds that Brazil could manage its sizable debt load in the long term.

Ms. Schineller said there is a "greater than 1-in-3 likelihood" that early efforts to fix the economy could be unwound given Brazil's fiery politics. Citing resistance in Congress to spending-cut and tax-raising measures pushed by President Dilma Rousseff's administration, she said that Brazil is now likely to take longer to reverse its economic problems.

But nervousness about S&P's move could be exaggerated, some analysts said.

"Honestly, it isn't so bad. What would've been really bad is a credit-rating cut," said Pablo Spyer, from Mirae, an asset-management firm in São Paulo. "The outlook cut means the government needs to work on adjustments" to economic policy, he said.

This year the Brazilian government has been trying to eliminate expensive tax breaks and subsidies it used in the past few years to stimulate the economy.

The past policies made the debt balloon, but failed to restore growth. GDP was flat last year and is expected to contract by 2% in 2015, according to some forecasts.

But reversing course has proved difficult, as a weakened Ms. Rousseff has lost influence with an increasingly rebellious Congress. Her approval rate was a mere 7.7% in a recent poll, and leaders of both houses have opposed fiscal-austerity measures.

Declining tax revenue forced Finance Minister Joaquim Levy to reduce this year's target for a primary surplus, or government savings before interest payments, to 0.15% of GDP from 1.1% of GDP last week. The primary surplus is seen as a gauge of the country's ability to pay down debt.

S&P cited increased risks that impeachment proceedings be initiated against President Rousseff, as well as political backlash against her administration in Congress.

"Fluidity in the political dynamics has increased more recently...this is going to weigh on execution" of economic policy, Ms. Schineller said.

S&P also mentioned ongoing corruption investigations that involve high-profile politicians as a risk factor. Prosecutors are probing what they describe as a cartel of some of the country's largest construction firms allegedly skimming billions of dollars from government-controlled energy giant Petróleo Brasileiro SA, or Petrobras, for at least a decade. Part of the proceeds, prosecutors say, was illegally diverted to politicians, some of them from Ms. Rousseff's own Workers' Party.

Petrobras has said it is a victim in the alleged scheme and is cooperating with investigations. President Rousseff hasn't been accused in the process and has denied any knowledge of wrongdoing at Petrobras. The Workers' Party has repeatedly denied wrongdoing.

In a separate case, Brazil's government accounting watchdog has called into question the administration's 2014 books, and may recommend that Congress reject the accounting, in which case the president might be subject to an impeachment process.

Write to Paulo Trevisani at paulo.trevisani@wsj.com