Boeing Co. has agreed to pay a $12 million penalty to the U.S. government and make broad changes in how it builds commercial aircraft to settle complaints that its safety and quality processes fell short of standards.

The penalty is the second-highest in an enforcement case ever settled by the Federal Aviation Administration. Additional penalties of as much as $24 million could be levied if Boeing does not adhere to the accord in the next five years, the FAA said Tuesday in a statement.

Among other requirements, Boeing must improve management oversight, accountability and internal audits; conduct more training; and "meet progressively more stringent performance metrics in the quality and timeliness" of reports to the FAA.

"It is imperative that everyone complies with our aviation system's high safety standards," Transportation Secretary Anthony Foxx said in the release. "This agreement is an important step toward ensuring that Boeing fully meets all applicable compliance standards going forward."

The accord settles two FAA enforcement cases and 11 other matters brought to Boeing's attention in recent years. The most significant case, dating to 2012, alleged that Boeing missed a deadline to provide airlines with instructions to install devices on the 747 and 757 jets to prevent fuel-tank explosions. These devices, which pump in nitrogen gas to prevent a fire, were required after a TWA jumbo jet exploded and killed 230 people in an ocean crash off Long Island in 1996.

In a second case, the FAA said in 2013 that Boeing used improper fasteners on 777s and then failed over a two-year period to correct the issue. Boeing "repeatedly submitted action plans that set deadlines for the accomplishment of certain corrective actions, but subsequently failed to implement those plans," the FAA said in a release at the time.

While the violations involved delays in adopting critical safety equipment and a failure to monitor manufacturing processes, the FAA said Tuesday that they didn't introduce "unsafe conditions" on aircraft in service.

Boeing said that "many of the improvements listed in the agreement have already been implemented" or are being put in place.

The accord "fairly" resolves the enforcement cases and "also will further enhance Boeing's self-correcting quality and compliance systems," the company said in a statement.

The case is the most that an aircraft manufacturer has ever paid the FAA in an enforcement action. American Airlines, which later became American Airlines Group Inc., agreed in 2013 to pay $24.9 million to settle several enforcement cases.