UBS (NYSE: UBS) agreed to sell $8 billion in unwanted assets to Apollo (NYSE: APO) as part of the carve-out of Credit Suisse’s securitized products group, after renegotiating key parts of the accord.

UBS will book a net gain of about $300 million in the first quarter related to the matter while Credit Suisse is expected to recognize a net loss of $900 million. The deal allows UBS to close another chapter in its acquisition of Credit Suisse and accelerate the disposal of unwanted assets. It had been renegotiating the terms of the SPG deal since last year, in part because its executives were unhappy with the fees Credit Suisse had agreed to pay Apollo to manage assets that remained on its books, Bloomberg News reported.