Target (TGT -0.22%) is getting rid of its consumer credit card portfolio, selling it in its entirety to Canada-based Toronto-Dominion Bank (TD -0.57%) for $5.9 billion, according to a Target press release.

The two companies also agreed to a seven-year deal where TD will "underwrite, fund, and own future Target Credit Card and Target Visa receivables in the United States." TD will acquire more than 5 million active Visa and private label accounts.

The two companies entered into a profit-sharing agreement as well, the specifics of which were not released. Target did say it would continue to receive a "substantial portion of the profits" from the portfolios over the seven-year period.

Target will put 90% of the net proceeds toward reducing its debt, and will put the remainder toward share repurchases. Target expects some slight dilution to adjusted EPS in the first 12 months after the close, though after that the effects are expected to be neutral, according to the press release. The deal is expected to close in the first half of 2013.