Bank of America_Charlotte
A Bank of America customer uses an ATM in Charlotte, North Carolina, April 18, 2012. Reuters/Chris Keane

(Reuters) - Bank of America Corp is close to a deal with the U.S. Department of Justice to pay more than $16.5 billion (£9.79 billion) to end investigations into mortgage securities that the bank and companies it bought sold in the run-up to the financial crisis, a person familiar with the matter said on Wednesday.

A settlement would likely cap more than four years of work by Brian Moynihan, the bank's chief executive, to rid Bank of America of nearly all of the massive mortgage liabilities it took on through the acquisitions of Countrywide Financial Corp and Merrill Lynch & Co by his predecessor, Kenneth Lewis.

The bank has agreed to pay about $9 billion in cash and the rest in assistance to struggling homeowners, said the person, who was not authorized to speak publicly about the matter.

Lawrence Grayson, a Bank of America spokesman, declined to comment.

A $16.5 billion payout would be the largest in a series of soaring penalties against banks for a range of misconduct, including violating U.S. sanctions and inappropriately marketing mortgages.

JPMorgan Chase & Co paid $13 billion last year to resolve similar civil fraud claims that it misled mortgage bond investors, and Citigroup Inc agreed to pay $7 billion over similar charges last month.

Those two settlements and the one expected with Bank of America are the product of a task force President Barack Obama directed the Justice Department to convene in 2012 to examine fraud in mortgage securities that helped fuel the financial collapse. The announcement came after his administration faced criticism that it was not sufficiently holding accountable those who contributed to the crisis.

The Wall Street Journal first reported on Wednesday the progress in settlement talks.

Negotiations between Bank of America and the government continued on Wednesday, with a meeting between Bank of America general counsel Gary Lynch and the No. 3 official at the Justice Department, Tony West, two people familiar with the talks said. An announcement of a final deal is not expected this week.

The agreement in principal was reached after a phone call last week between Moynihan and Attorney General Eric Holder, sources said.

Bank of America had earlier sought a meeting between Moynihan and Holder, but the Justice Department had declined the request last month.

Last week the bank raised its earlier offer of $14 billion, to resolve three Justice Department investigations as well as claims from the Federal Deposit Insurance Corp and several states, sources said.

The phone call between Moynihan and Holder came after U.S. District Judge Jed Rakoff in Manhattan on Wednesday ordered Bank of America to pay a $1.27 billion penalty for what he called a "brazen fraud" over shoddy mortgages sold by Countrywide, which the bank bought for $2.5 billion in July 2008.

While a jury last October found the second-largest U.S. bank liable for the conduct, it was not clear how large a penalty the bank might face.

Bank of America had argued it should have owed nothing because Countrywide lost money on the loans.

The separate Justice Department negotiations were driven by allegations about securities sold by Merrill, which the bank also agreed to acquire in 2008, people familiar with the matter have said.

Analysts have said the purchases of Countrywide and Merrill have already cost Bank of America well over $50 billion through litigation, loan buybacks and other mortgage relief.

According to a regulatory filing, about $245 billion, or just over one-fourth, of the $965 billion of mortgage-backed securities and loans issued between 2004 and 2008, and sold to private investors - and now attributed to Bank of America - are either in default or severely delinquent.

Countrywide accounted for $187 billion, or 76 percent, of the problematic securities, while Bank of America accounted for just $10 billion, or 4 percent. The rest came from Merrill and the former First Franklin Financial Corp, which Merrill bought in 2006.

The consumer help portion of the settlement is expected to mirror past deals, which included cutting loan balances for underwater borrowers, refinancing mortgages, and other types of help to struggling homeowners.

Bank of America shares closed Wednesday up 20 cents at $15.20 on the New York Stock Exchange. They were little changed after market hours.

The news of the deal comes just after Bank of America said the Federal Reserve approved its plan to raise its quarterly dividend for the first time since the financial crisis.

Illinois Attorney General Lisa Madigan is involved in the negotiations, according to her spokeswoman. New York Attorney General Eric Schneiderman has also been involved in the talks, a separate person familiar with his involvement said. A spokesman for Schneiderman declined comment.