Visa, Mastercard and a number of US banks agreed to pay $6.2 billion to settle a long-running lawsuit brought by merchants over the fees they pay when they accept card payments. 

Visa and Mastercard previously reached a $7.25 billion settlement with the merchants in the case, but that deal was thrown out by a federal appeals court in 2016 and the US Supreme Court last year refused to revive it. 

The deal had been the largest all-cash US antitrust settlement, although its value shrank to $5.7 billion after roughly 8,000 retailers opted out. 

The card issuers named in the class-action lawsuit include JPMorgan Chase & Co, Citigroup and Bank of America. 

The lawsuit was brought on behalf of about 12 million retailers and dates back more than a decade.

It accuses the credit card companies of violating federal competition laws by forcing merchants to pay swipe fees and prohibiting them from directing consumers toward other methods of payment. 

In rejecting the earlier settlement, which was opposed by retailers including Amazon.com, Costco Wholesale and Walmart, a federal appeals court found that the accord was unfair because some retailers would receive little or no benefit. 

The card companies have already paid $5.3 billion and will now pay an additional $900m. 

Mastercard will pay an additional $108m from funds set aside in the second quarter, the company said. 

Visa's share represents around $4.1 billion, which the company expects to pay using funds previously deposited with the court, and from a litigation escrow it set up on June 28. 

The settlement must still be approved by a court.