Mortgage finance giant Freddie Mac said Tuesday that three of the country's largest banks — Wells Fargo, Citigroup and SunTrust Banks — had agreed to pay a total of $1.3 billion to resolve claims on millions of home loans that have soured or may go bad.

Freddie Mac, along with sibling Fannie Mae, has been seeking compensation from banks that it claims misrepresented the quality of home loans sold to it during the housing boom.

When the housing market crashed, homeowners defaulted on those loans en masse, saddling the mortgage finance companies with billions of dollars in losses.

Wells Fargo, Citigroup and SunTrust are among many lenders that sell home loans to Freddie Mac and Fannie Mae, which bundle them into mortgage-backed securities and cover the losses if a homeowner defaults.