The merger would create the world's largest airline.
As part of the agreement, which must still be approved by a judge, the airlines will give up slots at several US airports.
The two companies argued the consolidation was necessary to their survival.
The US Justice Department had sued to stop the $11bn (Â£6.9bn) merger in August, arguing it would reduce competition and result in higher prices for consumers.
"This agreement has the potential to shift the landscape of the airline industry...[and] ensures airline passengers will see more competition on nonstop and connecting routes throughout the country," said Attorney General Eric Holder in a statement.
The two airlines will each give up 57 slots to low-cost carrier airlines at Ronald Reagan International Airport in Washington DC and 34 slots at LaGuardia Airport (LGA) in New York City.
The companies say this will result in 44 fewer daily departures at Reagan and 12 fewer daily departures at LGA - a fraction of the close to 400 daily flights that the airlines operate from those two airports.
"They dominated Reagan Airport, that's why they had the Department of Justice concerned," Ray Neidl, an airline analyst at Nexa Capital, told the BBC, who said that giving up slots at the airport was an unsurprising part of the agreement.
"It was better than litigating," he added.
An additional two slots each at Boston Logan International, Chicago O'Hare International, Dallas Love Field, Los Angeles International and Miami International airports will be released.
The slots will be given to low cost airlines like JetBlue and Southwest.
"This agreement allows us to take the final steps in creating the new American Airlines," said Tom Horton, head of American Airline's parent corporation, AMR, in a statement.
The company now says it expects the merger to be finalised in December 2013.
AMR Corp has been in a bankruptcy restructuring for two years and it is hoped that once the merger is finalised, the company will be able to complete its turnaround.
Shares in US Airways traded 3.5% higher before being halted on pending news. They were lower once the specifics of the deal had been announced.
The anti-trust trial had been scheduled to start later this month.
The US Justice Department had been joined by the attorneys-general of Arizona, Florida, Pennsylvania, Michigan, Tennessee, Virginia, and the District of Columbia, but all have agreed to the proposed settlement.

The annual inflation rate stayed at 0.2%, according to the flash estimate from the EU's statistics agency Eurostat.
Energy prices fell 5.6%, compared with a 5.1% drop in June. Food, alcohol and tobacco prices rose 0.9%.
Eurostat also said that the unemployment rate was unchanged at 11.1% in June, for the third month.
James Howat, European Economist at Capital Economics, said the figures were not positive: "Worryingly, surveys of employment intentions have weakened recently, suggesting that the labour market recovery will remain pretty weak."
He also pointed out that the ECB still has a lot of work to do to hit its inflation target of "below, but close to, 2%".
In March, the ECB began a massive â‚¬1.1 trillion bond buying programme in an attempt to stimulate the eurozone economy.
Policymakers spent much of last year in fear of deflation. The worry is that if price falls become entrenched, consumers and businesses will delay purchases and investment in the expectation that prices will fall further.

All of the managerial movements for October will appear below, followed by the full list of each club, league-by-league.
To read the list for September, visit the ins and outs page.
American Airlines and US Airways have settled an anti-trust suit with US regulators, paving the way for their proposed merger to be finalised.
[NEXT_CONCEPT]
Inflation in the eurozone held steady in July, as falling energy prices offset rises in industrial goods.
[NEXT_CONCEPT]
BBC Sport tracks all the manager ins and outs as well as listing all the current bosses in the Premier League, Scottish Premiership, English Football League and National League.