Mastercard and Visa have urged a federal judge in Brooklyn to grant final approval to a $38 billion settlement with merchants over credit card swipe fees. The proposed deal seeks to resolve a legal battle that has lasted two decades. It received preliminary approval in June.

Merchants allege that the card networks and major banks violated antitrust laws by charging excessive fees to process transactions.

Under the settlement, swipe fees would be reduced by 0.1 percentage point. The reduction would last five years. Standard consumer card fees would be capped at 1.25%. The cap would remain in place for eight years.

The deal would also end the Honor All Cards rule, giving merchants more flexibility to refuse certain credit cards, including premium rewards cards that carry higher fees.

Mastercard and Visa say the settlement is a fair compromise that would fundamentally change their relationship with merchants. Some major retailers and trade groups oppose the deal, arguing that it offers insufficient relief.

The judge has not issued a final decision. The judge noted that rejecting the agreement could lead to a protracted trial.