SÃO PAULO, Brazil — Political parties whose symbol is a red star tend to be unfavorable for bankers, but Brazil’s ruling party has been a lucrative exception.

When the Workers’ Party of former President Luiz Inácio Lula da Silva and current President Dilma Rousseff took power in 2003, it promised, and for many years delivered, a rising standard of living for the country’s poor and working classes.

Yet the gains have been much more impressive for the nation’s banking industry, even as the manufacturing sector has stagnated and the broader economy has ridden the ups and downs of global commodity prices. The combined annual profits of Brazil’s four biggest banks have grown more than 850 percent to just over $20 billion, from $2.1 billion, in the 12 years of Workers’ Party rule.

Even as a corruption scandal centered in the government-owned petroleum giant Petrobras has paralyzed important sectors of the economy, bank profits have kept growing.