Top executives from several big Brazilian construction and engineering firms have been released from prison but will remain under house arrest for their alleged role in a massive kickback scheme at state-run oil company Petrobras.

The chief executive officer of the UTC Engenharia firm and the vice president of Engevix left prison on Wednesday after being locked up for six months.

Brazil's Supreme Court ruled Tuesday evening that nine executives should be allowed to be under house arrest as they await possible trial on corruption charges.

Prosecutors say they've uncovered the biggest known corruption scandal to hit Brazil. It involved firms paying bribes to Petrobras executives in return for winning inflated contracts.

Petrobras said last week it lost at least $2.1 billion to the long-running corruption scheme.