DALLAS (AP) — Boeing will not face a criminal conspiracy charge due to two 737 Max jetliner crashes that killed 346 people, after a federal judge in Texas last week granted the federal government’s request to dismiss the case.

As part of a deal to drop the charge, the American aerospace company has agreed to pay or invest an additional $1.1 billion in fines, compensation for the crash victims’ families, and internal safety and quality measures.

The agreement also lets Boeing choose its own compliance consultant rather than appointing an independent monitor.

Prosecutors alleged Boeing deceived government regulators about a flight-control system that was later implicated in the fatal flights.

The ruling follows a hearing in September in Fort Worth at which relatives of some of the victims urged U.S. District Judge Reed O’Connor to reject the deal and instead appoint a special prosecutor to take over the case.

O’Connor last week wrote that the deal “fails to secure the necessary accountability to ensure the safety of the flying public.”

Still, he said, the court can’t block the dismissal simply because it disagrees with the government’s view that the deal serves the public interest.

The Justice Department has said a trial risks a jury verdict that spares Boeing from further punishment. The judge also said the government hadn’t acted in bad faith, had provided reasons for the dismissal and had met their obligations under the Crime Victims’ Rights Act.

All passengers and crew members died when two 737 Max jetliners went down less than five months apart in 2018 and 2019 — a Lion Air flight that plunged into the sea off the coast of Indonesia and an Ethiopian Airlines flight that crashed into a field after taking off from Addis Ababa.

The long-running case has taken many twists and turns since the Justice Department first charged Boeing in January 2021 with defrauding the American government, including a failed deal that would have required the company to plead guilty.

That plea agreement fell through after O’Connor did not approve it.

In a statement issued after the ruling, Boeing said they were committed to honoring their agreement with the Justice Department, as well as “continuing the significant efforts we have made as a company to strengthen our safety, quality and compliance programs.”

The Justice Department has said the families of 110 crash victims either support resolving the case before it reaches trial or did not oppose the deal.

Meanwhile, nearly 100 families have opposed the agreement. More than a dozen relatives spoke at the Sept. 3 hearing, some of whom traveled to Texas from as far as Europe and Africa.

“Do not allow Boeing to buy its freedom,” said Catherine Berthet, who traveled from France to ask the judge to send the case to trial. Her daughter, Camille Geoffroy, died in the crash in Ethiopia.