(Recast with payment, adds Treasury official comments and context)
By Alonso Soto
BRASILIA, Dec 30 (Reuters) - Brazil said on Wednesday it repaid its massive debts to state-run banks, in a step towards reining in swollen budget deficits that cost the country its investment grade rating and threaten the stability of President Dilma Rousseff's government.
Opposition parties have used the debts totaling about 57 billion reais ($14.43 billion) to request the impeachment of Rousseff, accusing her of breaking budget laws to boost her reelection campaign last year.
The repayment of those liabilities, amassed over the last three years in a practice known in Brazil as "backpedaling", aims to prevent contaminating the fiscal results in 2016 as the administration scrambles to shore up its accounts.
The accumulated debts symbolized a period of high public spending during Rousseff's first term that eroded public finances and investors' trust in Latin America's largest economy, which is now mired in its worst recession in 25 years.
The administration, which denies any wrongdoing, repaid most of the debt using resources from the Treasury account in December, officials said on Wednesday.
A remaining 1.5 billion reais will be paid via a bond sale on Thursday.
The debts were owed to state lenders Banco do Brasil, Caixa Economica Federal and state development bank BNDES as well as the state workers' pension fund, FGTS. The Treasury said it paid an additional 16.8 billion reais to state banks during 2015 for a series of credit and social programs.
"Just like in 2015, we will continue to repay on time all our expenditures," Interim Treasury chief Otavio Ladeira told reporters in the capital Brasilia.
Although the repayment puts an end to the "backpedaling", it will do little to help Rousseff mend ties with a rebellious Congress.
"The opposition will read this as the government's acknowledgment that it did something wrong," said Thiago de Aragao, a partner at political analysis firm Arko Advice. "Her relations with Congress will remain precarious."
The real slumped 2 percent on Wednesday, chiefly driven by traders' efforts to weaken the currency and get the official rate for the month closer to 4 per dollar. Concerns over how the government plans to end the "backpedaling" also added to losses, traders noted.
Lower House Speaker Eduardo Cunha, a fierce government foe who approved the start of impeachment proceedings this month, said Tuesday that the repayment could not undo previous irregularities.
He said the lower house will decide by March whether to recommend Rousseff's impeachment.
In December, Fitch became the second credit ratings agency to cut its rating on Brazilian debt from investment-grade to junk status, which meant that many foreign investments funds, under their bylaws, could no longer invest in the country. ($1 = 3.9504 Brazilian reais) (Additional reporting by Silvio Cascione; Editing by W Simon and Chizu Nomiyama)