Mortgage insurer MGIC Investment Corp. and bond insurer Radian Group Inc. agreed to terminate their pending merger, the companies said on Wednesday, citing market conditions.

MGIC agreed in February to acquire Radian in a $5.47 billion all-stock deal, but since then MGIC shares have lost more than half their value, amid the turmoil in the mortgage and housing markets.

The companies also said that all outstanding litigation between MGIC and Radian will be withdrawn. No payments were exchanged in connection with the termination agreement.

MGIC had sued Radian in late August seeking information to use to back out of the deal. Milwaukee-based MGIC filed the lawsuit after saying on August 7 it was not obligated to complete its acquisition of Philadelphia-based Radian.

A week earlier, the companies revealed that their $1.03 billion investment in subprime mortgage joint venture C-BASS could be worthless, after defaults and margin calls mounted.

Radian said on Wednesday it will provide an update regarding its business strategy and key financial information in a conference call at 10 a.m. on Wednesday.

(Reporting by Joseph Giannone and Mark McSherry)