Residential Capital, the mortgage company liquidating assets in bankruptcy, agreed to pay $297.6 million to end opposition by government-run loan investor Fannie Mae to the sale of ResCap’s main business.

The ()agreed to drop its objection to the $3 billion sale of ResCap’s mortgage servicing unit to Ocwen Financial Corp. [stock OCN">, according to a court filing last night in U.S. Bankruptcy Court in Manhattan.