JPMorgan agrees $13 bln settlement with U.S. over bad mortgages

* Relates to charges the bank overstated mortgage quality

* JPMorgan says did not admit to violating any laws

* Funds already set aside; share price rises

By Karen Freifeld, Aruna Viswanatha and David Henry

NEW YORK/WASHINGTON, Nov 19 (Reuters) - In late September, JPMorgan Chief Executive Jamie Dimon walked into the office of U.S. Attorney General Eric Holder.

"We're willing to take our lumps," he said, according to a person briefed on the matter.

"We don't think there were serious mistakes made," he added, in a meeting he had requested with Holder.

JPMorgan finally took its punishment on Tuesday, agreeing to a $13 billion settlement with the U.S. government to settle charges that the bank overstated the quality of mortgages it was selling to investors in the run-up to the financial crisis.

The Department of Justice trumpeted its settlement as a big step toward holding banks accountable for their behavior before the financial crisis.

The behavior that the largest U.S. bank admitted to, authorities said, is at the heart of what inflated the housing bubble: lenders making bad mortgages and selling them to investors who thought they were relatively safe. When the loans started turning bad, investors lost faith in the banking system, and a housing crisis turned into a financial crisis.

The Justice Department said in its statement that JPMorgan acknowledged it had regularly and knowingly sold mortgages to investors that should have never been sold.

But JPMorgan's Chief Financial Officer, speaking on a conference call, said the bank had not admitted to violating any laws. CFO Marianne Lake added that the facts the bank admitted to did not leave it vulnerable in other litigation.

In other words, the bank and the government did not agree about what they had agreed to in the settlement, capping weeks of squabbling over the terms of the deal.

At issue in Tuesday's settlement was the long chain of companies between lenders giving mortgages to consumers during the mortgage bubble and the investors that ultimately forked over the money to fund the loans. Often smaller lenders would make subprime mortgage loans, and sell them to a bank, which would package loans into bonds, and in turn sell them to investors.

With so many middlemen, investors had poor information about what they were buying, and capital flowed to loans that arguably should never have been made.

When the air hissed out of the U.S. mortgage market, investors said they were gulled, and that the mortgages they bought were not good enough in the first place to have been sold. Banks for their part have said that mortgages failed not because they failed to meet investors' stated standards, but because the housing market as a whole headed south.