The Federal Housing Finance Agency reached settlements worth $5.1 billion with JPMorgan Chase & Co. in connection with residential mortgage-backed securities and single-family mortgages purchased by Fannie Mae and Freddie Mac, the agency announced today.

JPMorgan agreed to pay $4 billion—$1.26 billion to Fannie Mae and $2.74 billion to Freddie Mac—to address claims that the company violated federal and state securities laws when it sold securities to the companies between 2005 and 2007. That settlement includes securities sold by JPMorgan, Bear Stearns Cos. Inc. and Washington Mutual.