When federal investigators first identified signs of corruption at Petrobras in 2009, Dilma Rousseff insisted Brazil's state-run oil company had nothing to hide.
"Petrobras has one of the most accurate accounting standards in the world," said Rousseff, who was then chairwoman of its board and is now Brazil's president. "If it wasn't the case, investors would not be seeking out the company as one of the great investment targets."
Today, it's clear her confidence was misplaced.
Petrobras now acknowledges it overpaid on contracts for years.
Prosecutors say engineering firms paid bribes to win Petrobras contracts, systematically overcharged it to the tune of billions of dollars and funneled a cut of the money to corrupt executives, vendors and political parties, including Rousseff's ruling Workers' Party.
A Reuters review of a 2009 federal investigation of Petrobras, and interviews with those who conducted it, indicates Rousseff missed opportunities to stop the graft before it erupted into a crisis so big it could push Brazil's slow-growing economy back into recession next year.
Rousseff says she did not know about the corruption, or participate in it, when she was Petrobras' chairwoman from 2003 to 2010.
Opposition leaders say they believe her and that she is unlikely to face impeachment. Polls show her popularity has suffered only slightly.
Still, she faces mounting scrutiny over whether she did enough to halt the corruption at Brazil's biggest company by revenue. The scandal could haunt her in her second term as president, which began on Thursday.
Petrobras' stock has fallen nearly 50 percent in the last six months and its market value is down more than 80 percent from its peak in 2008.
Two top former executives and three dozen other suspects allegedly involved in the scheme have been indicted.
The accounting standards that Rousseff praised are now in such disrepute that independent auditors have refused to certify Petrobras' quarterly results because, pending further investigation, they are unable to put a value on its assets.
Records from the Federal Audits Court, or TCU, show that investigators detected widespread over-charging on contracts and irregular tendering practices at major Petrobras projects. They included the Abreu e Lima refinery in northeast Brazil, the biggest single investment project in Petrobras' history.
The TCU advised both the government and Petrobras' directors in a report that was sent directly to Rousseff and her board.
Investigators say they would have uncovered even more abuses if Petrobras hadn't refused to provide key documents.
The TCU's findings were "a clear warning sign of bigger problems and likely corruption," Saulo Puttini, who was one of the auditing officials, told Reuters. "What's happening now is not a surprise to us at all."
DEEP INVOLVEMENT
Rousseff said in a statement on Nov. 22 that she reacted properly to the TCU report and noted it detailed only a portion of the wrongdoing that has since been uncovered. A spokesman referred recent queries regarding Petrobras to that statement.
A senior official close to Rousseff said Petrobras' decision not to share more information with the TCU at the time was made by Rousseff's subordinates.
"It never crossed her desk," the official said.
Overseeing Petrobras was not Rousseff's only job, though people who worked with her say it was her passion.
An economist with a zeal for energy issues, she was also energy minister from 2003 to 2005 and President Luiz Inacio Lula da Silva's chief of staff until 2010.
Rousseff oversaw Petrobras during a rise in its fortunes that paralleled Brazil's commodities-driven economic boom.
She attended monthly board meetings, weighed in on investment priorities and successfully pushed for a rewrite of Brazil's oil law to make Petrobras a mandatory partner in new deep-sea finds.
"She was involved deeply and emotionally in Petrobras," said Ildo Sauer, the former head of its natural gas and energy unit who worked with Rousseff during those years.
Petrobras found huge new offshore oil resources starting in 2006 and its market value soared to more than $290 billion in 2008 from $15 billion a decade earlier.
But problems were cropping up. The TCU, which is an office of Congress and audits federal spending, in 2008 began reviewing contracts for the Abreu e Lima refinery after spending estimates started to rise sharply.
In its 2009 report, the TCU cited irregular tender practices and systematic over-charging on Abreu e Lima contracts. It also criticized Petrobras for waiting until the last day of the investigation to deliver many documents, saying it was tantamount to obstruction.
After receiving the findings, Rousseff alerted the Comptroller General's office, which in Brazil's regulatory system is responsible for the protection of public property.
It found no wrongdoing but its ability to do its job has been widely questioned. Its chief Jorge Hage resigned last month after complaining that budget cuts mean it has trouble paying telephone and electricity bills, much less the expense of tracking corruption.
Investigators believe Rousseff should have done far more.
"They could have undertaken an investigation, they could have fired an executive, but they didn't take any steps. They just kept sending money" for Petrobras projects, said Jose Jorge, who was one of nine TCU judges before he retired in November.
PROBLEMS WITH OVERSIGHT
The TCU recommended stopping construction of Abreu e Lima until the irregularities were addressed. Congress agreed and voted to suspend 2010 budget payments on some contracts cited by the TCU.
However, Rousseff, who was preparing to run for president, overruled the recommendations, warned stoppages could cause unemployment and persuaded Lula to veto that part of the budget proposal.
Construction continued, and so did the problems. Abreu e Lima, budgeted at $9.2 billion in 2009, more than doubled to $18.5 billion in 2014, partly because Venezuela's state-run oil company PDVSA pulled out of helping to finance the project.
The TCU continued to flag irregularities in reports on the refinery in 2010, 2011, 2012 and 2013.
Silvio Sinedino, a Petrobras director representing its employees, said the board failed to detect graft because it had become a "rubber stamp" for the government.
"The government doesn't want oversight," he said, adding that important financial information on projects is often only provided on the day of meetings and that government officials try to strong-arm the board.
Sauer said Rousseff would regularly summon him and other top Petrobras executives to the capital Brasilia.
"Those meetings were among the most unpleasant of my life ... Not only were they long, but they involved her yelling a lot," he said, adding he had to leave Petrobras after losing favor with Rousseff because he opposed some projects that she supported.
The extent of the corruption at Petrobras became apparent after Paulo Roberto Costa, its former refining chief, was arrested on March 20. He testified that he helped orchestrate a kickback scheme with a "cartel" of construction companies that inflated prices on work they did.
"I can't remember a company that failed to pay," he said.
Other arrests followed and prosecutors say more are expected.
Costa and other witnesses say Abreu e Lima was ground zero for much of the corruption. Puttini, the TCU investigator, said "some of the people in jail now" are the same ones he questioned back in 2009.
The senior official close to Rousseff says she is "stunned" by the extent of the graft. "No one believed anything on this scale could have happened in Brazil."
The probe has forced Petrobras to freeze spending on dozens of projects, leading to thousands of workers being laid off.
Economists say it could shave 1 percentage point or more off economic growth in 2015. That could be enough to push Brazil into a recession.