(Adds comment by minister, last paragraph)
BRASILIA, Feb 17 (Reuters) - President Dilma Rousseff's main coalition partner, the fractious Brazilian Democratic Movement Party (PDMB), re-elected a key ally of hers as its leader in the lower house of Congress on Wednesday, enhancing her chances of blocking impeachment.
Leonardo Picciani was confirmed as PMDB house whip in a 37-30 vote, defeating a rival backed by Rousseff's arch-enemy Speaker Eduardo Cunha, who took up an opposition request to impeach the president in December.
Picciani's re-election brought some relief for the embattled president because he is expected to pick pro-Rousseff PMDB members to sit on a committee that must decide whether there are grounds for her impeachment.
The vote showed Rousseff can muster crucial support among the ranks of the PMDB, Brazil's largest party, that will have a central role in deciding the survival of the country's most unpopular president in three decades.
The victory helped soften a new blow to Rousseff's credibility. Standard & Poor's on Wednesday downgraded Brazil's credit rating deeper into junk territory due to its failure to plug a growing fiscal deficit that has rattled investor confidence as the country sinks into recession.
Rousseff's opponents want to impeach her for allegedly juggling government accounts to increase public spending in the run up to her re-election in October 2014.
Brazil's Supreme Court, most of whose members were appointed since Rousseff's Workers' Party first took office in 2003, came to her aid in December by reducing the role of the lower house in the impeachment process and increasing the authority of the Senate, where she has more support.
The attempt to unseat Rousseff was weakened by corruption allegations that threaten to bring down Cunha, who is fighting for his own survival since prosecutors accused him of having secret bank accounts in Switzerland. Cunha faces charges of taking bribes in the massive graft scandal surrounding state-led oil company Petroleo Brasileiro SA.
Wednesday's vote was so uncertain that one of the six PMDB members of her cabinet, Health Minister Marcelo Castro, resigned temporarily so he could resume his seat in Congress and cast his vote for Picciani, leaving his post for a day despite a raging public health crisis caused by the spread of the Zika virus.
"The government has been strengthened by Picciani's victory. This was an important day for our party and for Brazil's political stability," Castro told reporters. He said he would be back wearing his minister's hat on Thursday. (Reporting by Maria Carolina Marcello; Writing by Anthony Boadle; Editing by Chizu Nomiyama)