Apollo Global Management Inc. and Franklin Templeton are among investors that bought $750 million of debt backing the buyout of Citrix Systems Inc., helping Wall Street banks chip away at billions of dollars in risky loans clogging their balance sheets.

Some of the more than 30 lenders that helped fund the LBO of the software company sold the term loans, reducing the $6.5 billion of debt they’ve been left holding for about two months, according to people with knowledge of the matter.

Diameter Capital Partners, which Apollo owns a stake in, also bought a portion of the $750 million debt, said the people, who asked not to be identified discussing a private transaction.

The Citrix financing was widely seen as a turning point in U.S. credit markets earlier this year, signaling that an era of easy money was drawing to an end as the Federal Reserve hikes rates.

Wall Street banks are sitting on about $40 billion of buyout and acquisition debt that they couldn’t sell, according to data compiled from deals in the U.S. and Europe by Bloomberg, including an estimated $12.5 billion tied to the buyout of Twitter Inc.

Some lenders have seized more stable markets in recent weeks to chip away at their exposure, but the backlog threatens to curtail banks’ ability to provide financing for deals down the line.

The latest Citrix transaction reduces the amount of $2.5 billion of debt, known as a term loan A, that banks were forced to hold themselves. Banks providing more than $15 billion of debt financing for the LBO managed to sell just $8.55 billion of bonds and loans before the buyout closed, and had to offload it at a steep discount.

Representatives for the lead arrangers of the Citrix debt — Goldman Sachs Group Inc., Bank of America Corp., and Credit Suisse Group AG — declined to comment, as did those for Apollo and Diameter. A representative for Franklin didn’t immediately respond to requests for comment.

The unsold buyout debt has forced Wall Street to record losses, but selling chunks of the debt, even at a discount, is better than letting it sit on books as it ties up capital that could be deployed elsewhere.

Debt from other deals funded by banks has also recently found buyers, including about $4 billion of bonds and loans tied to the buyout of Nielsen Holdings.

Representatives for Vista Equity Partners and Elliott Investment Management, which bought Citrix, didn’t immediately respond to requests for comment.