Boeing [BA] on Thursday agreed to a pay a $2.5 billion fine to resolve the U.S. government’s investigation into the company’s 737 MAX passenger aircraft, which has been grounded since March 2019 following two catastrophic crashes of the aircraft that month and in October 2018 that resulted in 346 people being killed.

The settlement with the Department of Justice includes a $243.6 million penalty, $500 million in additional payments to the families of those lost in the two crashes, and nearly $1.8 billion to Boeing’s airline customers to compensate them for losses due to the grounding of the 737 MAX, which began a phased return to service in December. Boeing has already made partial payments to its impacted airline customers, partially offsetting the amount agreed to in the settlement.

Boeing said it will take a $743.6 million charge in its 2020 fourth quarter financial results, which will be reported later this month, to account for the settlement’s impact on the company. Boeing has been suffering financial losses for more than a year due to the grounding of the aircraft.

“I firmly belief that entering into this resolution is the right thing for us to do, a step that appropriately acknowledges how we fell short of our values and expectations,” David Calhoun, Boeing’s president and CEO, said in a note to employees. “This resolution is a serious reminder to all of us how critical our obligation of transparency to regulators is, and the consequences that our company can face if any one of us falls short of those expectations.”

The crashes of the aircraft were blamed on faulty flight control software.