BRASILIA — If Brazilian President Dilma Rousseff thought it was tough imposing austerity measures in the first half of the year, she may be in for some unpleasant surprises in the second.

She has lost support from Senate Chief Renan Calheiros and his lower-house counterpart, Eduardo Cunha, amid growing discontent with a recession and a corruption probe into legislators. Calheiros, who likened Brazil’s atmosphere to a horror movie with no end in sight, and Cunha are pushing for inquiries into alleged wrongdoing at federal institutions and have delayed votes on key bills designed to raise revenue.

Growing dissent risks further undermining a president who is already struggling to deal with the country’s biggest economic and political crisis in a quarter century. While an outright revolt against her authority is not yet in the cards, the unrest makes it harder for her to push through an austerity agenda deemed crucial to avoiding a credit downgrade.

Cunha’s Brazilian Democratic Movement Party, the largest in the ruling alliance, hasn’t followed his lead by abandoning the government, but many of its legislators want to distance themselves from Rousseff, said political analyst Gabriel Petrus. Lawmakers may step up dissent as prosecutors intensify probes into more than 50 politicians on allegations of graft.

“Many legislators are thinking of saving their own skin and not the economy, so we’ll see more protest votes than we already have,” said Petrus, who works at business consulting firm Barral M Jorge in Brasilia. “The risk of undoing some of the progress we’ve seen so far has risen substantially.”

The cost to buy protection against a default in Brazil as measured by credit-default swaps has surged 13 basis points to more than a three-month high so far in July as talk of starting impeachment proceedings against Rousseff intensifies.

“Chatter about impeachment and scope for a fiscal target revision have become top-tier issues,” Mark McCormick, a foreign-exchange strategist at Credit Agricole SA in New York, wrote in an e-mail. “Political uncertainties are increasing Brazil’s risk premium.”

Activists from the Bastardxs women's rights movement demonstrate against money being diverted from a corruption scandal in the Brazilian state-owned oil company Petrobras to finance parties and luxury prostitution for company directors and Brazilian politicians, outside the headquarters of the company in São Paulo, Brazil on July 20, 2015. Nelson Almeida/AFP

The political crisis intensified July 17 when Cunha identified himself as a member of the opposition and urged his party, known as the PMDB, to leave the ruling coalition. He made the decision after an informant accused him of receiving kickbacks in exchange for a contract with state-run oil company Petrobras. He denied wrongdoing and said the charges are part of a government campaign to weaken him.

As head of Cunha’s party, Vice President Michel Temer now plays a bigger role than ever in securing support for Rousseff, according to Marcos Troyjo, who teaches and co-heads an emerging markets forum at Columbia University in New York.

Finance Minister Joaquim Levy repeatedly has said that Congress must act fast to approve the administration’s austerity plan to avert a sovereign-credit downgrade. Moody’s Investors Service last year placed Brazil on negative outlook.

While lawmakers in May approved three government bills to raise taxes and curtail spending, the Rousseff administration in June and July faced opposition to its belt-tightening agenda.

Legislators went on recess last week without voting on a bill that would raise revenue by creating incentives for Brazilians to pay a tax and repatriate money. The Senate delayed voting on a proposal to raise corporate sales taxes.

Cunha and Calheiros also could lead Congress in overriding presidential vetoes on “fiscal bombs” such as amendments that boost pensions and increase salaries for judiciary workers, Eurasia Group wrote in a research note last week.

Analysts surveyed by the central bank forecast the government will miss its 2015 primary budget surplus target, which excludes interest payments, equal to 1.1 percent of gross domestic product.

Cunha also is instrumental in deciding whether to hold impeachment hearings against Rousseff, who is defending her administration from charges it doctored budget results and broke campaign rules last year. The government denies wrongdoing.

Following two mass protests earlier this year in favor of Rousseff’s ouster, Cunha said last week that congressional lawyers are looking at the legal basis of requests to impeach the president. The lower house leader indicated Saturday he isn’t trying to take down the president, writing on his Twitter account he has no “agenda of revenge.”

The Rousseff administration is working to improve relations with Congress and considered criticism from an ally as normal, Eliseu Padilha, Brazil’s aviation minister and member of the PMDB, said after a cabinet meeting Monday.

The presidential press office didn’t respond to a request for further comment on the matter.

While the PMDB will eventually break with Rousseff’s ruling Workers’ Party to launch its own candidate for president in 2018, it will sit tight for now and let her take the blame for the recession, Columbia’s Troyjo said.

An indictment of Cunha could erode his power and strengthen Rousseff, said Troyjo.

Politicians being probed for graft also include Calheiros, a member of the PMDB, and some from the Workers’ Party.

The PMDB’s lower house deputies will meet in early August to discuss their position in the coalition, said Danilo Forte, the party’s deputy leader in the lower house. Anti-government street protests scheduled for Aug. 16 will provide some guidance, he said.

“If the people go to the streets and are persistent, the PMDB may decide to leave.”

— With assistance from Anna Edgerton in Brasilia and Paula Sambo in São Paulo.