Nearly a quarter of a century after it began, one of the largest legal disputes in defense industry history was finally settled with two major weapons makers agreeing to pay the federal government $400 million in goods and services.

The U.S. Court of Federal Claims in Washington on Thursday dismissed the lawsuit, filed in 1991, after Boeing Co. and General Dynamics Corp. agreed to provide so-called in-kind consideration, valued at $200 million each.

"We are closing a 23-year-long chapter in the annals of naval aviation and further strengthening, through the contractors' in-kind payment, the Navy's capabilities and capacities," Secretary of the Navy Ray Mabus said. "The litigation was protracted and difficult, but it saved the Navy billions of dollars."

The case stemmed from the 1991 decision by then-

Defense Secretary Dick Cheney to cancel a $4.8-billion contract to build the stealthy A-12 Avenger II heavy attack bomber, which was set to replace the aging A-6 Intruder on Navy aircraft carriers.

Faced with massive cost overruns, however, the government also demanded that McDonnell Douglas Corp., which Boeing would later acquire, and General Dynamics repay $1.3 billion they already received.

Instead, the companies sued on claims the government wrongfully terminated their contract. They sought an order allowing them to keep the money paid and to be paid $1 billion more for work already completed, plus interest.

What followed was a messy, tortuous path through U.S. courts that involved millions of subpoenaed documents, five trials and three appeals — including one to the U.S. Supreme Court. At one point, a total of about 60 lawyers for the companies and the Justice Department were working full-time on the case.

The bitterly fought ordeal was perceived as another misstep in President Reagan's defense buildup, which had been criticized for the spending of billions of dollars on the A-12 and other failed programs, such as the Army's Sgt. York anti-aircraft gun and the Strategic Defense Initiative, more commonly known as the Star Wars missile defense system.

Under the settlement, General Dynamics will provide a credit to the Navy against a contract to build the DDG-1000 Zumwalt-class guided missile destroyer. Boeing will provide the Navy with three EA-18 Growler electronic attack jets and will convert the existing cost-plus contract — in which prices are subject to change — for the jets to a fixed-price contract.

"Boeing is pleased that this decades-old litigation has come to an end," spokesman John Dern said. "We appreciate the efforts of the Navy and the Justice Department to resolve this matter, once and for all, on terms acceptable to all parties."

The U.S. government said it would not pay any money in connection with the companies' claims.

In 1988, General Dynamics and McDonnell Douglas signed a contract to build the A-12, which had a flying wing design. It would have been the Navy's first stealth-type aircraft. But in late 1990, after assuring Congress that the program was in good shape, Cheney learned that several admirals allegedly failed to disclose serious problems in the program, and he fired them.

Just several weeks later, Cheney was further embarrassed by the disclosure that the A-12 program was $2 billion to $9 billion over budget. He canceled the program in January 1991.

The Navy issued a termination order, saying that the two contractors were behind schedule developing the jet and that the aircraft was too heavy.

Under complex contract regulations, the Navy issued a default termination, meaning the contractors would be forced to repay the government the money they had received. The companies then sued.

The government and the companies had agreed to settle in the fall, but a special law had to be passed to allow the Navy to accept in-kind services as payment to settle a lawsuit.

"We are gratified that this decades-long litigation has been amicably resolved," said Stuart F. Delery, assistant attorney general for the Justice Department's civil division. "The resolution provides value to the government and brings this protracted and complex dispute to an end."

The settlement was authorized as part of the National Defense Authorization Act for Fiscal Year 2014, which President Obama signed into law Dec. 26.

william.hennigan@latimes.com

Times staff writer Ralph Vartabedian contributed to this report.