A bankruptcy judge on Wednesday approved a settlement in which the U.S. government-owned Ally Financial Inc will pay $2.1 billion to its bankrupt Residential Capital LLC unit.

Judge Martin Glenn also said he will unseal a report by a bankruptcy examiner probing Ally's role in ResCap's collapse. The report had been sealed as the parties hashed out a settlement.

The deal is a key step in ResCap's eventual exit from Chapter 11 protection, and will allow Ally to focus on paying back the U.S. government roughly $10 billion outstanding on a $17 billion loan.

(Reporting by Nick Brown; Editing by Gerald E. McCormick)