Odebrecht: Brazilian construction giant in the crosshairs
Brazil's emergence in the global economy during the recent boom years brought rewards for average Brazilians, who saw their incomes rise.
Many businesses saw their operations blossom too.
Among them, one stood out as a clear winner: Odebrecht group, which owns Latin America's biggest construction company.
Under the leadership of chief executive Marcelo Odebrecht, whose grandfather founded the company, the group more than doubled in size and revenue in 10 years.
It now has 181,000 employees in 21 countries.
The company won contracts across the world - to expand the Caracas metro system, build a port in Cuba and carry out many infrastructure projects in Africa.
When Brazilian presidents travelled abroad, Odebrecht executives were regular fixtures in the usual business entourage.
On 29 July, Mr Odebrecht was formally charged with corruption and money laundering, and accused of paying millions of dollars in bribes to senior officials at the state oil company Petrobras to secure lucrative building contracts.
Now held in jail, he denies all the charges.
The scale of the Petrobras scandal in the Brazilian economy is unprecedented. It has cost Petrobras alone $2bn (£1.3bn).
The country's private construction sector was thrown into disarray.
Presidents of all six of Brazil's top construction companies - with combined revenue of almost $10bn - are either behind bars or awaiting trial. They all stand accused of bribing officials in exchange for Petrobras contracts.
This scandal is changing the way politicians and companies do business with each other.
Odebrecht and other construction firms are big donors in Brazilian elections - for parties both in the ruling coalition and opposition.
Their cosy relations with governments can be rewarding.
During Brazil's boom years, construction firms benefited from loans given by Brazil's development bank BNDES with special interest rates well below the market rate.
Odebrecht topped the list of BNDES loans - receiving $8bn, or 70% of the total money lent between 2007 and 2015.
Prof Sergio Lazzarini, a teacher at Sao Paulo's Insper Business School, who wrote a book on state capitalism, says this marriage of convenience between construction firms and politicians has been historically encouraged by two factors in Brazil.
"First there was little investigation into corruption practices. And second, when the government is more ambitious in its investments, it opens up opportunities for private businesses, who have more stimulus to influence the political scene," he says.
As the Brazilian economy grew, the role of the state in the private sector increased too.
In 2000, credit given by state bank BNDES accounted for 5% of Brazil's national output; that share grew to 12%, says Prof Lazzarini.
Now, he argues, the relationship between construction firms and the state is turning sour.
Founded in 1944 by Norberto Odebrecht
1953: Completed first project for Petrobras, an oil pipeline in north-east Brazil
1960s: Expands in south-east Brazil, building Petrobras main office building in Rio de Janeiro
Also builds campus of the Federal University of Rio de Janeiro, Galeao International Airport (pictured above) and the Angra I Thermonuclear Plant
1970s: Wins first international contracts
1991: Odebrecht becomes the first Brazilian company to complete a public construction project in the US
2011: Named one of the 10 companies most admired by young Brazilians
Today: 181,000 employees working in 21 countries
Brazil's massive investigation into Petrobras is ending years of lax attitudes towards corruption. Also the Brazilian state is cash-strapped and is having to reduce the role of BNDES.
Investing in politicians will be less rewarding for businesses, especially if Brazil reforms its election donation laws.
The arrest of Latin America's top construction industry boss also has the potential to influence Brazil's political future.
A prosecutor in Brasilia has launched a separate investigation into the relationship between Odebrecht and former president Luiz Inacio Lula da Silva, known as Lula.
The firm paid him to travel to countries including Cuba, Ghana, Venezuela, Portugal and the Dominican Republic after he had left office.
The authorities want to know whether Lula illegally peddled his influence with global leaders to help Odebrecht gain contracts in those countries.
Both Lula and the company vehemently deny any wrongdoing, saying the former president was hired to talk in business conferences.
This investigation is being launched at a moment of turmoil in the Brazilian political landscape.
President Dilma Rousseff has seen her approval ratings drop to record lows, and there are street protests calling for her impeachment - even though no legal argument has been presented against her.
Many in the Workers' Party see Lula as the only possible politician who could defeat the opposition and keep Brazil's left in power, and there have been calls for him to make a comeback.
The former president is a towering love-him-or-hate-him figure in Brazilian politics, but recent reports have taken a toll, and polls suggest his image has been tarnished.
Under fire from all sides, Mr Odebrecht is fighting back from the small cell in the city of Curitiba where he is being held.
Some of those involved in the Petrobras probe have struck plea bargains with the authorities, offering confessions in return for shorter prison sentences.
But not 47-year-old Mr Odebrecht. He says he is determined to clear his company's name even if it means confronting the system.
He is taking on the authorities, accusing them of turning the Petrobras probe into a "judicial reality TV show".
Several days ago, a judge ordered Mr Odebrecht to explain some of his notes that had been seized in which he apparently referred to politicians both in government and in the opposition.
Mr Odebrecht's lawyers said they would not explain anything to a judge with "merchant's ears".
Before his arrest in June, Mr Odebrecht had defended Brazil's policy of promoting companies abroad with BNDES money, saying the support created jobs and wealth for Brazilians.
Meanwhile, the company keeps on building, even with its boss behind bars. It is involved in some of Brazil's most ambitious projects, such as the Rio Olympics, the Belo Monte dam in the Amazon and procurement of the country's first nuclear submarine.
As the case against Mr Odebrecht advances, there will be a lot more at stake than just his own future or that of his company.