SEATTLE, Wash. — Boeing will pay $2.5 billion to settle a criminal charge related to its 737 Max jet.

The Justice Department announced the settlement nearly two years after the second of two crashes that killed 346 people in total.

Boeing is agreeing to pay money for crash victims’ families, airline customers and airlines, as well as a fine.

The first crash occurred in October 2018 in Indonesia, and a second occurred five months later in Ethiopia.

In both cases, an automated system pushed the noses of the planes down, and pilots were unable to regain control.