Boeing will pay $2.5 billion to settle a Justice Department investigation and admit that employees misled regulators about the safety of its 737 Max aircraft, which suffered two deadly crashes shortly after entering airline service.

The government and the company said Thursday that the settlement includes money for the crash victims' families, airline customers and a fine.

Prosecutors said Boeing employees gave misleading statements and half-truths about safety issues with the plane to the Federal Aviation Administration, then covered up their actions.

“Boeing's employees chose the path of profit over candour,” said David Burns, acting assistant attorney general for the Justice Department's criminal division.

Boeing blamed two former pilots who helped determine how much training was needed for the Max. CEO David Calhoun said their conduct doesn't reflect Boeing employees as a whole or the character of the company.

“This is a substantial settlement of a very serious matter, and I firmly believe 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,” Calhoun said in a memo to employees.

The government will drop the criminal charge of conspiracy to defraud the U.S. after three years if Boeing follows the terms of the settlement.

The settlement removes uncertainty about criminal charges against the iconic U.S. aircraft maker, which is struggling to put the Max crisis behind it. Boeing still faces lawsuits by the families of passengers who died in the crashes, it has lost more than 1,000 orders for the Max, and its once-stellar reputation for engineering has suffered.

Boeing began working on the Max in 2011 as an answer to a new, more fuel-efficient model from European rival Airbus. Boeing admitted in court filings that two of its technical pilot experts deceived the FAA about a flight-control system called the Maneuvering Characteristics Augmentation System, or MCAS, that could point a plane's nose down if sensors indicated the plane might be in danger of an aerodynamic stall - that it might fall from the sky.

The system was not part of previous 737 models. MCAS was added because the Max's larger engines, which are mounted higher and farther forward on the 737's low-swept wings, gave the plane a tendency to tilt too far nose-up in some conditions.

Boeing downplayed the significance of MCAS and didn't mention it in airplane manuals. Most pilots didn't know about it.

The first airlines began flying the 737 Max in mid-2017. On Oct. 29, 2018, a Max operated by Indonesia's Lion Air plunged into the Java Sea. The FAA let the Max keep flying, and on March 10, 2019, another Max operated by Ethiopian Airlines crashed nearly straight down into a field. In all, 346 people were killed.

On both flights, MCAS was activated by a faulty reading from a single sensor. The system repeatedly pushed the planes' noses down, and pilots were unable to regain control.

After the planes were grounded worldwide, Boeing changed MCAS so that it always uses two sensors, along with other changes to make the automated system less powerful and easier for pilots to override. The FAA ordered other changes, including the rerouting of some wiring to avoid potential dangerous short-circuiting.

In November, the FAA approved Boeing's changes, and several carriers including American Airlines have resumed using the planes.

Under the settlement announced Thursday, Boeing will pay a $243.6 million fine, $1.77 billion in compensation to airlines that were unable to use their Max jets while they were grounded, and $500 million into a fund for the families of passengers who were killed in the crashes.

Boeing faces dozens of lawsuits by families who lost relatives in the crashes. Three lawyers pressing cases in the Ethiopian crash said the settlement would not affect their pursuit of compensation.

Zipporah Kuria, a U.K. citizen whose father died in the Ethiopian crash, said that with the settlement, Boeing leaders were seeking to “pay their way out of accountability.” The agreement “won't bring back our loved ones, but at least there is clarity that their deaths weren't incidental and there is clarity in liability.”

House Transportation Committee Chairman Peter DeFazio, D-Ore, meanwhile, said the settlement amounted to “a slap on the wrist” for a company the size of Boeing.

“I hope the DOJ can explain its rationale for this weak settlement to the families, because from where I sit this attempt to change corporate behaviour is pathetic and will do little to deter criminal behaviour going forward,” DeFazio said in a statement.

Boeing said in a regulatory filing that it will take a $743.6 million charge against earnings because of the settlement.

The crashes and grounding of the Max, Boeing's bestselling plane, has plunged the Chicago-based company into its deepest crisis. It has led to billions in losses and resulted in the ouster of former CEO Dennis Muilenburg in December 2019.