Target has ended its dispute with MasterCard over the retail giant's 2013 data breach that leaked 40 million credit card details, by agreeing to a $19 million reimbursement to issuers, reports Reuters.

The fee was agreed in order to compensate credit card issuers for the costs of canceling and creating new accounts, as well as sending out new cards to affected customers, explains CNET.

The deal, which has been months in the making according to The Wall Street Journal, will only go ahead if 90 percent of the eligible MasterCard accounts agree to the terms by May 20. If the terms are agreed then card issuers including Citigroup Inc. and Capital One Financial Corp. will be paid by Target by the end of the second quarter.

"We are hopeful that Target’s agreement to pay up to $19 million to settle the claims of MasterCard and its issuers will result in a high level of issuer acceptance. Target intends to continue to defend itself vigorously against any assessments made by MasterCard on behalf of MasterCard issuers that do not accept their offers," explained Scott Kennedy, Target's president of financial and retail services in a statement.

Target says that the estimated costs of the settlement are already accounted for in the data breach liabilities the company established during the 2013 and 2014 fiscal years.

The Wall Street Journal notes that this settlement is strictly limited to MasterCard based card issuers, but that the company is looking to come to a similar arrangement with Visa, which is larger.