JPMorgan Chase has reached a tentative agreement with the Justice Department to pay a record $13 billion to resolve allegations that it knowingly sold faulty mortgage securities that contributed to the financial crisis, a person familiar with the talks said Saturday.

The agreement to pay the penalty would cap weeks of heated negotiating and underscore the extent of the bank’s legal woes.

If finalized, the deal would be the largest penalty ever paid by a single company. The agreement would represent a tremendous win for the government after years of public criticism over its struggle to hold Wall Street accountable for its crisis-era misdeeds.

It would also leave JPMorgan and its executives at risk of criminal prosecution, a humbling concession.

The nation’s largest bank emerged from the financial crisis relatively unscathed, but it has struggled to shake off the vestiges of that era. Like many banks, it has been accused of selling bad residential mortgages to investors, including Fannie Mae and Freddie Mac, who lost billions when the housing market crashed.

JPMorgan and the Justice Department have been negotiating a potential deal for months. Talks heated up a few weeks ago and eventually included direct discussions between the bank’s chief executive, Jaime Dimon, and Attorney General Eric Holder.

The deal would resolve an array of state and federal investigations into the bank’s sale of troubled mortgage investments. That type of investment, securities backed by subprime home loans, was at the heart of the financial crisis.

While the deal would put those civil cases to rest, it would not save JPMorgan from a parallel criminal inquiry from federal prosecutors in California, according to sources who spoke with The New York Times. Under the terms of the preliminary deal, the people said, the bank would also have to assist prosecutors with an investigation into former employees who helped create the mortgage investments.

Taking a toll

The barrage of federal investigations and multibillion-dollar settlements led JPMorgan to report its first loss in nearly 10 years this month. The bank suffered a net loss of $380 million after setting aside an additional $9.2 billion for future litigation expenses.

The $13 billion deal, which could still fall apart over issues such as how much wrongdoing the bank is willing to acknowledge, would represent something of a reckoning for Wall Street, whose outsize risk-taking in the mortgage business nearly toppled the economy in 2008.

For the Justice Department, often criticized for being soft on big banks, the deal suggests that the Obama administration’s crackdown on Wall Street has gained some momentum in recent months.

“Resolving the mortgage cases for $13 billion is a major win for the DOJ, particularly since the deal only applies to the civil case,” said Thomas Gorman, a securities lawyer at Dorsey Whitney. “It also brings to account a major Wall Street player for the market crisis, something enforcement officials and the public have been looking for.”

Penalty details

The cost to JPMorgan goes beyond the bottom line. The settlement would deal a reputational blow to the bank and Dimon, who steered JPMorgan through the crisis without a quarterly loss or major government scuffle.

The $13 billion penalty, according to one of the people briefed on the talks, would include about $9 billion in fines and $4 billion in relief for struggling homeowners.

A spokesman for JPMorgan declined to comment. Brian Fallon, a Justice Department spokesman, declined to comment.

The penalty, if approved, would surpass other major Wall Street settlements and represent the largest that a single company has ever paid in settling with the Justice Department. HSBC, for example, agreed to a $1.9 billion penalty last year over money laundering accusations. BP paid $4.5 billion for its role in the huge oil spill in the Gulf of Mexico.

The penalty also eclipses what JPMorgan previously offered to pay. Until now, the bank was offering about $11 billion in total. And it had refused to increase its offer unless the California authorities dropped the criminal investigation into the bank’s sale of troubled mortgage securities to investors.

But the bank, one of the people briefed on the talks said, tentatively backed down from that demand, a major victory for the government and one that allows the Justice Department to pursue its criminal investigation.

One significant obstacle stands in the way of a deal: whether JPMorgan will admit to all of the improper actions cited by the Justice Department. Banks are typically loath to acknowledge wrongdoing, fearing it could expose them to a raft of shareholder lawsuits.

Officials for the bank and the government are negotiating over a statement of facts in the case that would address the wrongdoing issue, the people briefed on the talks said. Those negotiations could hit a snag if JPMorgan seeks to limit the conduct that the Justice Department wants to include.

The Washington Post,

The New York Times

AT A GLANCE: FROM HOUSING BOOM TO INVESTMENT BUST

Selling mortgage securities was a brisk business for Wall Street for many years. But then the housing bubble burst.

HOW IT WORKED: Banks such as JPMorgan, after issuing loans to homebuyers, would pool hundreds of mortgages and market the bundles as investments that could be traded just like stocks.

THE PROBLEM: When the housing market crashed, the securities were worthless. Investors were saddled with massive losses.

WHAT DID THE BANK KNOW? A key issue during the discussions with the Justice Department has been whether JPMorgan and its executives would face criminal prosecution for allegedly knowing that the bank was selling bad mortgages. The government is unwilling to give the bank amnesty from criminal prosecution in this agreement.