LOS ANGELES Jose Melena was loading tons of tuna into industrial ovens at Bumble Bee Foods when any worker's worst nightmare occurred — he got trapped inside and the massive pressure cooker was turned on.

Melena's grisly death in a 132 C oven three years ago led to a $6 million agreement by Bumble Bee on Wednesday to settle criminal charges in what Los Angeles District Attorney Jackie Lacey said was the largest payout in a California workplace-violation death. The sum was four times greater than the maximum fines the company faced.

"This is the worst circumstances of death I have ever, ever witnessed," said Deputy District Attorney Hoon Chun, who noted that he had tried more than 40 murder cases over two decades. "I think any person would prefer to be — if they had to die some way — would prefer to be shot or stabbed than to be slowly cooked in an oven. "

Melena, 62, perished at the seafood company's Santa Fe Springs plant after a co-worker mistakenly believed he was in the bathroom.

The company didn't have safety procedures that would have required the equipment be turned off with an employee inside or provide an escape route or a spotter to keep watch with a worker in a confined space, Hoon said.

In a rare prosecution of a workplace fatality, Bumble Bee, its plant Operations Director Angel Rodriguez and former safety manager Saul Florez were each charged with three counts of violating Occupational Safety & Health Administration rules that caused a death.

Each party reached a different plea agreement Wednesday in Los Angeles Superior Court.

Bumble Bee agreed to plead guilty in January 2017 to a misdemeanour of having wilfully failed to provide an effective safety program. First, however, it must complete several safety measures that include spending $3 million to upgrade ovens so workers can't get trapped inside, and providing worker training.

Florez, 42, of Whittier was sentenced to three years of probation and will face fines and penalties of about $19,000 after pleading guilty to a single felony count of violating a workplace safety rule that caused a death.

Rodriguez, 63, of Riverside, agreed to plead guilty in 18 months to a misdemeanour and pay about $11,000 after he completes 320 hours of community service and worker safety courses.