The Justice Department says it has reached an agreement to allow American Airlines and US Airways to merge, creating the world’s biggest airline.

The agreement requires the airlines to scale back the size of the merger at Washington’s Reagan National Airport and in other big cities.

In August, the government sued to block the merger, saying it would restrict competition and drive up prices for consumers on hundreds of routes around the country.

The airlines have said their deal would increase competition by creating another big competitor to United Airlines and Delta Air Lines, which grew through recent mergers.

The settlement reached Tuesday would require approval by a federal judge in Washington. It would require American and US Airways to give up takeoff and landing rights or slots at Reagan National and New York’s LaGuardia Airport and gates at airports in Boston, Chicago, Los Angeles, Dallas and Miami to low-cost carriers to offset the impact of the merger.

Attorney General Eric Holder said the agreement would ensure more competition on nonstop and connecting routes throughout the country. The department called the slot and gate divestitures at key airports “groundbreaking.”