A sign outside the headquarters of JP Morgan Chase & Co in New York, September 19, 2013.

Reuters/Mike Segar

WASHINGTON/NEW YORK JPMorgan Chase & Co has reached a tentative $13 billion (8.03 billion pounds) deal with the U.S. Justice Department and other government agencies to settle investigations into bad mortgage loans the bank sold to investors before the financial crisis, a source familiar with the talks said on Saturday.

The tentative deal, the largest ever between the U.S. government and a single company, does not release the bank from criminal liability for some of the mortgages it packaged into bonds and sold to investors.

That had been a major sticking point in the discussions, but the government refused to budge on that issue and JPMorgan felt it had no choice but to give in, according to a second source. Until recently, the most that JPMorgan was willing to pay was closer to $11 billion.

The ongoing criminal investigation underscores how even if this settlement takes some heat off JPMorgan Chief Executive Jamie Dimon, he still has myriad regulatory issues to deal with.

The biggest U.S. bank sidestepped the worst of the financial crisis but now faces more than a dozen probes globally into everything from alleged bribery in China to a possible role in manipulating benchmark interest rates known as Libor.

While JPMorgan investors have publicly supported Dimon, privately many have expressed frustration at his run-ins with regulators. A Senate subcommittee report in March detailed how Dimon demanded that subordinates withhold data from one of the bank's regulators, the Office of the Comptroller of the Currency. Earlier this month, the bank said that Dimon was no longer chairman of JPMorgan's main U.S. retail banking subsidiary, which press reports said happened at the request of the OCC.

JPMorgan's board of directors has pressured Dimon to improve his relationship with government regulators and enforcement officials.

The preliminary $13 billion settlement was reached after he spoke by phone on Friday night with U.S. Attorney General Eric Holder to finalize the broad outlines of the deal, the first source said. Dimon went to Washington to meet with Holder on September 25, and discussed an $11 billion deal at that point.

"They are trying to do whatever they can to get this behind them," said Walter Todd, chief investment officer at Greenwood Capital Associates, which owns JPMorgan shares.

At issue in the settlement is whether the bank sold mortgages that it knew were riskier than they appeared. Investors, including government-owned mortgage agencies Fannie Mae and Freddie Mac, said that the bank told them loans were better than they actually were, or that the bank was negligent in accepting information from borrowers about their income and other matters at face value instead of verifying it.

Some 80 percent of the securities in the $13 billion settlement relate to investment bank Bear Stearns and mortgage lender Washington Mutual, which the government encouraged JPMorgan to buy after they essentially failed during the crisis.

'VERY PAINFUL'

The banks bolstered JPMorgan's bond trading and consumer banking businesses, and helped propel JPMorgan to record quarterly profits. But the legal costs connected with Bear Stearns and Washington Mutual have weighed on JPMorgan.

In the third quarter, the bank lost $380 million, its first quarterly loss since 2004, after it recorded a $7.2 billion after-tax charge for legal expenses. On a call with analysts, Dimon acknowledged that the losses from Bear Stearns and Washington Mutual were "very painful to the company."

Even so, the bank can easily afford this deal. It said earlier this month that it has set aside a total of $23 billion to cover legal settlements. In a typical quarter, it earns about $5 billion to $6 billion, and it has some $30 billion of cash on its books.

The Justice Department is leading the conversations between a host of government agencies and JPMorgan, the largest U.S. bank. As part of the deal, the bank will continue to cooperate in criminal inquiries into people involved in the conduct at issue, said the first source, and JPMorgan itself could still face criminal charges.

The settlement includes a $4 billion tentative deal with the Federal Housing Finance Agency that sources told Reuters about earlier this week.

A third source close to the matter characterized a broader $13 billion deal as likely, but cautioned that parts of the agreement are still being hammered out, and the settlement could conceivably fall apart. The bank's general counsel Stephen Cutler and Associate Attorney General Tony West are negotiating a statement of facts that will be part of a final agreement, the first source said.

Settlement talks started in September, as the Justice Department prepared to sue JPMorgan in California over mortgage securities that the bank sold in the runup to the financial crisis.

The bank and the Justice Department began discussing a broad deal that would resolve not only the inquiry into mortgage bonds it sold to investors between 2005 to 2007 that were backed by subprime and other risky residential mortgages, but also similar lawsuits from the FHFA, the National Credit Union Administration, the state of New York and others.

The broader settlement is a product of a government working group created nearly two years ago to investigate misconduct in the residential mortgage-backed securities market that contributed to the financial crisis. Officials from the Justice Department, the new York Attorney General and others help to lead the group.