The government plans to impose a deadline for JPMorgan Chase to dole out consumer relief as part of a tentative $13 billion settlement, insisting the bank would face an additional penalty if the condition is not met, according to people familiar with the negotiations.

A final deal between the Justice Department and the nation’s biggest bank is expected on Tuesday, said the people who were not authorized to speak publicly. Federal prosecutors have been working with JPMorgan for months to resolve allegations that the bank knowingly sold securities made up of low-quality mortgages in the lead-up to the financial crisis.

As of last month, the bank had agreed to a deal that would include $4 billion in aid to consumers, with an additional $7 billion set aside for investors and $2 billion for fines. Now officials at Justice, the Department of Housing and Urban Development and JPMorgan have hashed out additional terms for the consumer portion of the agreement.

The people familiar with the talks said at least $1.5 billion of consumer aid will go to reduce loan payments for struggling borrowers, including those whose mortgages are “under water,” or higher than the value of their homes. An additional $300 million must go toward other forms of forbearance, such as forgiving a portion of the loan until a later date to reduce payments now and increase the odds that borrowers will be able to remain in their homes.

The other half of the money can be used for an array of types of restitution to help other borrowers or communities hard hit by the mortgage crisis. Among the options: JPMorgan could lower interest rates on existing loans. Or it could originate new mortgages to low- and moderate-income borrowers — loans it would be forbidden from selling to investors and forced to keep on its own books to encourage responsible lending.

Finally, in an unusual arrangement, the bank could get credit for reducing blight by demolishing foreclosed homes or by absorbing the cost of mortgages on homes it has not foreclosed on but has effectively abandoned. The final option will be tied to specific Zip codes that experienced high rates of foreclosure and numbers of vacant homes.

JPMorgan will have to hire an independent monitor to supervise the entire process, an arrangement that would be similar to the $25 billion national mortgage settlement over foreclosure abuses.

The bank will have until the end of 2016 to comply with the agreement. If it fails to spend the entire $4 billion before that deadline, JPMorgan would have to pay an amount equal to the unexpended funds either to the government or to a third party designated by the government —such as a nonprofit that serves low-income homeowners. Other government settlements over mortgages have been criticized for being slow to produce results for consumers.

Officials at Justice, HUD and JPMorgan declined to comment.

HUD Secretary Shaun Donovan took the lead on hammering out the consumer portion of the settlement at the behest of Attorney General Eric H. Holder Jr., according to people familiar with the negotiations. Law enforcement officials have said Justice plans to include consumer aid in future deals with other banks being investigated for selling bad mortgages.

Nearly every major bank participated in the housing boom, issuing mortgages and bundling them into securities that were sold and traded like stocks. When the housing market crashed, investors lost billions and the banks were accused of selling mortgages that they knew were doomed.

Federal and state prosecutors, as part of the Obama administration’s mortgage task force, are looking into the sale, packaging and underwriting of home loans at nine other banks, including Bank of America, Wells Fargo and Citigroup.

In some cases, banks have been accused of dragging their feet in processing requests for lower mortgage payments or criticized for being stingy with restitution. Yet consumers have so far received upwards of $51.3 billion worth of loan modifications through the government’s national mortgage settlement.

At this point, it is not known which neighborhoods will benefit from the JPMorgan settlement or what exact metrics will be used to make the determination. Details of the agreement are being hashed out.

Negotiations between the Justice and JPMorgan have at times been tense.

There was a standoff over whether the bank or the Federal Deposit Insurance Corp. is responsible for losses on mortgage securities issued by Washington Mutual, the failed bank that JPMorgan bought out of receivership for $1.9 billion in 2008, according to people familiar with the negotiations. Some of those securities are a part of the complaints that JPMorgan is trying to resolve in its deal with Justice.

The bank has argued that it is not responsible for bad mortgage securities issued by Washington Mutual and that the FDIC, which put the bank in receivership, should cover the cost of those losses. But the FDIC said JPMorgan took on all of those liabilities when it purchased the bank.

People familiar with the dispute said it has been resolved, with JPMorgan agreeing to assume the liabilities.