NEW YORK (AP) — Visa and Mastercard say they and several banks will pay $6.2 billion to settle part of a long-running lawsuit brought by merchants over fees on credit card transactions.

Visa says it’s paying $4.1 billion and Mastercard is paying about $900 million. The two companies say they’ve already set aside money to cover the payment.

A group of 19 merchants and trade groups alleged Visa and MasterCard conspired to fix fees that are charged to stores for handling credit card payments. Tuesday’s settlement covers the monetary claims in the lawsuit, but a lawsuit over their network rules is ongoing.

The parties agreed to a financial settlement in 2012, but some retailers and consumer groups objected and that settlement was ultimately thrown out by a federal appeals court.