DALLAS (AP) - American Airlines and US Airways reached a deal with the government that lets the two form the world's biggest airline and opens up more room at key U.S. airports for low-cost carriers. The settlement announced Tuesday - if approved by a federal judge - would end a fight with the U.S. Justice Department and head off a courtroom showdown later this month. It preserves hub airports in Phoenix, Philadelphia, Charlotte and four other cities for at least three years. And it caps a series of mergers that have already eliminated four big U.S. airlines and stoked fear about higher travel prices. For American, the nation's third-biggest airline, the deal lets parent AMR Corp. exit bankruptcy protection, repay creditors and reward shareholders. At US Airways, the No. 5 U.S. carrier, shareholders will own 28 percent of the new company, employees stand to get more pay, and top executives will realize their dreams of running an airline even bigger than United or Delta. The Justice Department said it extracted the largest divestitures ever in an airline merger. For American and US Airways customers, they'll get reciprocal frequent-flier benefits in January and, executives said, more service to more places eventually. Doug Parker, the US Airways CEO who will run the new airline, even suggested that customer service will improve because workers will share in a more prosperous industry. William Baer, assistant attorney general for Justice's antitrust division, said that even a few more gates and flights for low-fare carriers would help consumers. He said that when Southwest picked up slots at Newark, N.J., as part of the 2010 merger of United and Continental, it had a ripple effect that reduced fares on many routes. The airlines were close to finishing the merger in August until the Justice Department and several states filed an antitrust lawsuit to block the deal, saying it would reduce competition on hundreds of routes around the country and lead to higher consumer prices. A trial was scheduled to begin Nov. 25. To avoid the uncertainty of a trial, American and US Airways agreed to give up about 15 percent of their takeoff and landing rights at Reagan National Airport near Washington - they'll still be the biggest airline there - and a smaller number of slots at LaGuardia Airport in New York. They also agreed to give up two gates each at Chicago's O'Hare Airport, Los Angeles International, Boston's Logan Airport, Dallas Love Field and Miami. That could help competitors grow at airports where gates are in short supply. And they promised to maintain flights to cities in six states that sided with the Justice Department. The settlement still needs the approval of a federal judge in Washington, but that is expected to be a formality, and the companies expect to close their deal in the first half of December. In afternoon trading, shares of US Airways Group Inc. rose 25 cents to $23.52, which would make the post-merger company worth more than $16 billion. AMR shares, which trade only over the counter, jumped 6 percent to $12. Shares of United, Delta, Southwest and JetBlue also climbed. When the deal closes, American and US Airways will begin coordinating prices and schedules as if they were one. Combining the fleets will take months or years. Robert Mittelstaedt, dean emeritus of the business school at Arizona State University, said the Justice Department "achieved about all they could reasonably expect to achieve." Regulators won concessions at Reagan National - important to government travelers including members of Congress - but would have struggled to prove the rest of their case, he said. Airfares in the second quarter of 2013 were 18 percent lower than in 1999 when adjusted for inflation, according to the government. With that, Mittelstaedt said, "it's hard to prove consumers are being harmed." J.P. Morgan analyst Jamie Baker said, "Why mince words? A win for the airlines" is how he viewed the settlement. The two airlines and some industry experts said the Justice Department had a weak case, especially after allowing four big airline mergers in the past eight years with few conditions. American and US Airways, however, were not willing to bet the fate of their multi-billion-dollar merger on the decision of a single judge. "We didn't think we should have to give up anything," Parker said in an interview. The lawsuit should not have been filed, but once it was, there is some risk in going all the way to trial. This settlement was worth doing rather than taking on that risk. If the airlines lost in court and the merger got scuttled, American and US Airways would have remained far behind United and Delta without any way to grow quickly. When it sued in August, the Justice Department was joined by six states, including Texas, where American is based, and Arizona, home to US Airways. But six weeks later, the Texas attorney general, a Republican who is running for governor next year and had been hammered by business groups for joining the Obama administration's lawsuit, settled with the airlines. AMR CEO Tom Horton said that side deal helped create momentum for a broader settlement. Shortly after that, Horton met with the attorney general of Florida, who expressed hope for a compromise. The new company will be called American Airlines Group Inc., replacing AMR, which will emerge from bankruptcy simultaneously with the merger closing. It will be slightly larger than United and Delta by passenger traffic and have about 100,000 employees and 6,700 daily flights to more than 300 destinations. It will be based at AMR's home in Fort Worth, Texas. Pete Yost in Washington contributed to this report. Follow Koenig at http://www.twitter.com/airlinewriter