(Adds market reaction, fiscal data, economist comments)
By Brad Haynes
SAO PAULO, Aug 28 (Reuters) - Brazil's economy shrank 1.9 percent in the second quarter, sinking into a recession that has hammered President Dilma Rousseff's popularity as she struggles to save the country's investment-grade credit rating amid a vast corruption scandal.
The quarterly contraction, reported by government statistics agency IBGE on Friday, was bigger than the median forecast of a 1.7 percent drop in a Reuters poll and confirms the worst slowdown for Brazil in nearly three decades.
A commodities-fueled economic boom has fizzled since Rousseff took office in 2011, and her stimulus efforts drove up public and private debt without spurring growth.
This year she reversed course, trying to cut government spending and subsidies as the central bank battles inflation. The austerity program has torn apart her governing coalition, but failed to lift business and consumer confidence from record lows.
Investment plunged 8.1 percent in the second quarter, its eighth straight decline. Household consumption, an economic engine during the boom years, fell 2.1 percent, the worst drop since 2001, due to rising unemployment, tighter credit and the highest inflation in over a decade.
"The drop in consumption shows the crisis of confidence the economy is facing," said Newton Rosa, chief economist with SulAmerica Investimentos. "This is going to be an intense and prolonged recession ... We can't hope for a recovery until at least the middle of next year."
The economy contracted 2.6 percent from the second quarter last year.
Brazil's sharp downturn is contributing to fears that fragile emerging markets will cripple global growth this year. A slowdown in China is already threatening commodity exporters across Africa and Latin America.
In Brazil, once flush with export revenues because of ravenous Chinese demand for iron ore and soybeans, industrial surveys, consumer defaults and online retail sales all show a recession that deepened in recent months.
Financial markets had expected poor growth data after months of grim indicators. Brazil's currency, the real, dropped 1 percent against the dollar and the Bovespa stock index was 0.1 percent lower. The real has depreciated 25 percent against the dollar this year and the Bovespa has lost 5 percent.
The economic slump has accentuated a mounting political crisis.
Rousseff's approval rating fell to single digits in recent polls, hit by the recession and mounting evidence of a kickback scheme that funneled billions of dollars away from state-run firms.
Brazil's biggest engineering groups have had executives jailed and contracts frozen in the scandal, paralyzing major public works and investments in the energy sector.
Political fallout from the scandal has also turned key congressional allies against Rousseff, weakening her austerity efforts and emboldening opposition cries for her impeachment.
Though there is little legal basis so far to justify impeaching Rousseff, who is not under investigation in the corruption probe, polls show two in three Brazilians support her ouster.
Government spending rose 0.7 percent in the second quarter. Fiscal data released separately on Friday showed a bigger-than-expected budget deficit in July, threatening the government's already lowered fiscal goal for the year.
Credit rating agencies have cut Brazil to near-junk status this year and warned of more downgrades if the government cannot close a budget gap and lay the foundations for economic growth.
"The economic activity indicators are critical for Brazil's investment grade rating," said Siobhan Morden, head of Latin America strategy at Jefferies. "At some point, you need a recovery to get more political support for the fiscal adjustment."
IBGE revised first-quarter growth to a 0.7 percent drop, down from a decline of 0.2 percent reported in May.
Economists expect Brazil's economy to shrink more than 2 percent this year, the worst drop since 1990, and keep contracting in 2016, according to a weekly central bank poll.
Neil Shearing, the chief emerging markets economist at Capital Economics, cut his forecast to a 2.5 percent drop in Brazil's economy this year, down from a 1.0 percent drop.
Rising exports were "the only ray of light" in Monday's data, he told clients in a note. "Otherwise, this is a shocking report."
Still, the slowdown in China has weakened demand for many of the raw materials that Brazil exports, cutting the price of iron ore in half and soybeans by a quarter compared to a year ago.
Brazilian officials warned this week that China woes could delay an modest recovery that they have been forecasting for late 2015 or early 2016. (Additional reporting by Asher Levine and Silvio Cascione in Sao Paulo, Rodrigo Viga Gaier and Caio Saad in Rio de Janeiro; Editing by W Simon and Kieran Murray)