Bank of America’s multibillion settlement could top the $13 billion agreement Justice reached with JPMorgan Chase. (Chuck Burton/AP)

Bank of America’s legal battles may be nearing an end as it negotiates a multibillion-dollar settlement with the Justice Department to cover a range of probes, a deal that may surpass the $13 billion that JPMorgan Chase paid to the government last year, people familiar with the talks said Friday.

The Justice Department made an initial offer of $20 billion to resolve several investigations, including allegations that Bank of America packaged and sold troubled mortgage securities to investors. The bank rejected that offer and has yet to counter, said the people, who were not authorized to speak publicly.

If the agreement lands close to the initial offer, it would easily trump the department’s landmark deal with JPMorgan over similar allegations. The deal could also go a long way to quell public criticism over the government’s struggle to hold Wall Street accountable for sins of the financial crisis.

It is unclear whether any Bank of America executives are at risk of criminal prosecution. People familiar with the talks say they are in the early stages and expect the sides to meet a few more times before a deal is reached.

Officials at Bank of America and Justice declined to comment.

A person familiar with the talks said the initial offer included money set aside for a settlement with the Federal Housing Finance Authority, which regulates Fannie Mae and Freddie Mac. The bank reached a $9.5 billion deal with the agency in March, which includes the repurchase of soured mortgage securities sold to the mortgage-finance twins.

When Bank of America announced the deal, officials noted that it could face fines from Justice and several state attorneys general for mortgage matters. The bank also highlighted possible penalties from other members of the Obama administration’s mortgage task force — federal and state attorneys assembled in 2009 to go after crimes related to the financial crisis.

The task force launched a working group in January 2012 to investigate misconduct in the mortgage-backed-securities market. The group has filed cases against Citigroup and Credit Suisse for allegedly misleading investors about the quality of the securities they sold.

It has launched similar probes into seven other banks: Wells Fargo, Citigroup, Goldman Sachs, Morgan Stanley, Royal Bank of Scotland, UBS and Deutsche Bank. And the group was the driving force behind the landmark JPMorgan settlement.

A key figure in the JPMorgan deal, Associate Attorney General Tony West, is also taking the lead in hammering out an agreement with Bank of America, according to a person familiar with the talks. West and his team carved out billions of dollars of mortgage relief for struggling homeowners, as well as aid for investors in JPMorgan securities, a template that could be used in crafting the latest agreement.

In the case of Bank of America, much of the bank’s legal troubles are tied to its $2.5 billion purchase in 2008 of Countrywide Financial, once one of the nation’s largest home lenders. Bank officials have said the ailing lender has cost the bank $40 billion in mortgage litigation and repurchases of soured loans.

Since October, Bank of America has been fighting to have a judgment thrown out that found it liable for fraud over thousands of defective mortgages sold by Countrywide. U.S. District Judge Jed Rakoff must rule on the penalty, which could top $848.2 million.

Not all of Bank of America’s legal headaches are tied to Countrywide. This month, the bank agreed to pay nearly $800 million in penalties for deceiving millions of customers into buying costly and unneeded services when they signed up for credit cards. The Consumer Financial Protection Bureau said the bank and its telemarketers, in an aggressive push to sell credit card add-ons, glossed over the terms or enrolled unwitting customers.