SÃO PAULO—Brazilian prosecutors allege that for at least a decade up until 2014, some of the country’s largest construction firms colluded to inflate the cost of contracts at state-owned oil giantPetróleo Brasileiro SA by an average of about 3%.

Crooked Petrobras executives who brokered the deals got a portion of the ill-gotten gains, authorities say, funneling the rest to a slush fund for lawmakers and political parties, the prosecutors say. A web of money launderers allegedly helped them hide the money overseas.

The criminal investigation, dubbed Operation Car Wash after a gas station that was allegedly used to launder money, came about almost by accident. In 2013, investigators in southern Brazil were tracking the movements of an admitted money launderer named Alberto Youssef. Their curiosity was piqued when Mr. Youssef gave a $78,000 Land Rover to a former Petrobras executive name Paulo Roberto Costa. Authorities said that break helped them uncover one of the largest corruption scandals in Brazilian history.

Aided by testimony from Mr. Youssef and Mr. Costa, who both turned state’s evidence in exchange for lighter sentences on money laundering and other charges, authorities have arrested or charged dozens of Brazilian construction executives. Most have denied involvement or say they are cooperating with officials.

Prosecutors are also investigating nearly 50 Brazilian politicians in connection with the case. They include the heads of Brazil’s lower house and Senate, who have denied wrongdoing. Authorities in April charged João Vaccari Neto, the treasurer of the ruling Workers’ Party, with corruption for accepting “irregular donations.” He has repeatedly denied wrongdoing.

The scandal has crippled Petrobras, Brazil’s largest and most important company. The company’s stock is down by nearly 50% since September. In late April, the company wrote off more than $16 billion related to losses from graft and overvalued assets.

The company’s woes have all but paralyzed the nation’s critical oil and gas sector. Hurt by slumping oil prices and strapped for cash, Petrobras has slashed investment, sparking a wave of credit downgrades, bankruptcies and layoffs among its suppliers that have weighed on Brazil’s economy.

—Marla Dickerson