JPMorgan Chase & Co (JPM) is expected on Tuesday to sign a $13 billion deal with the U.S. government to settle claims that the bank misrepresented the quality of the mortgages it sold to investors during the housing boom, two people familiar with the matter said.

The civil settlement marks the end of weeks of tense negotiations with JPMorgan, which is facing a welter of federal and state investigations by government lawyers under pressure to show they are holding banks accountable for wrongs that led to the housing collapse.

JPMorgan and government agencies led by the Justice Department tentatively reached an agreement in mid-October and have been hammering out details since then.

Earlier this week the bank and officials at the Justice Department and Department of Housing and Urban Development agreed to terms of a $4 billion relief package that is part of the broader deal, paving the way for the full announcement.

Last month the Federal Housing Finance Agency announced a related $5.1 billion deal to resolve claims about the quality of mortgage bonds it sold, $4 billion of which is part of the expected announcement.