Brazil's rating downgrade, which came sooner than many in the market had expected, reflected President Dilma Rousseff's struggle to regain investor confidence as political turmoil drives a growing government deficit in Latin America's largest economy.

The Brazilian real fell nearly 3 percent to a 13-year low of 3.9 per U.S. dollar before closing at 3.8497, down 1.3 percent on the day.

It was supported by a central bank intervention as well as by remarks from a senior Fitch Ratings analyst who said there are still "elements" supporting Brazil's investment grade.

The real has fallen 31 percent against the dollar this year as investors doubt the government's ability to shore up its finances and pull the economy out of its worst recession in 25 years.

"Everyone knew the downgrade was coming, but the fact that it came so quickly scared some people," said Andre Perfeito, chief economist with Gradual Investimentos in Sao Paulo.

He added: "People are looking to Brasilia for some kind of plan, but for now there is nothing to calm the market."

Finance Minister Joaquim Levy said on Thursday that the government is preparing strong measures to cut the country's budget deficit. He plans to have those measures ready to be debated and voted on in Congress in a couple of weeks.

Brazilian stocks posted modest losses, with the benchmark Bovespa stock index <.BVSP> falling 0.33 percent.

Companies whose earnings are primarily in dollars, such as mining firm Vale SA (>> Vale SA) and pulp producer Fibria Celulose SA (>> Fibria Celulose SA) lent support to the index, helping offset a 5.0 percent drop for state-run oil producer Petroleo Brasileiro SA (>> Petroleo Brasileiro Petrobras SA), known as Petrobras.

Petrobras and other heavily indebted companies such as airline Gol Linhas Aereas SA (>> Gol Linhas Aereas Inteligentes SA) led losses on the Bovespa due to concerns about higher borrowing costs after the credit downgrade.

Brazil's interest-rate futures <0#2DIJ:> jumped as investors demanded higher returns to hold Brazilian assets following S&P's downgrade. Yields paid on interest-rate contracts expiring in January 2023 <2DIJF23> rose 39 basis points to an all-time high of 15.15 percent.

(Additional reporting by Walter Brandimarte and Brad Haynes; Editing by Jeffrey Benkoe, W Simon and Ken Wills)

By Asher Levine