Compared with other government settlements over mortgages, the JPMorgan deal attempts to address a larger universe of housing problems plaguing U.S. cities. (JUSTIN LANE/EPA)

The Justice Department scored a colossal victory Tuesday in its record $13 billion settlement with JPMorgan Chase, and some communities devastated by the housing crisis could also walk away with a big win.

The landmark agreement, which resolves a myriad of government probes into the bank’s sale of defective mortgage securities, carves out more than $4 billion to help struggling homeowners and neighborhoods riddled with abandoned or foreclosed houses.

In addition, families in New York and Massachusetts will receive millions of dollars more in relief as attorneys general in those states dole out their part of the settlement money.

Compared with other government settlements over mortgages, the JPMorgan deal attempts to address a larger universe of housing problems plaguing U.S. cities.

A critical element of the agreement calls for the bank to demolish foreclosed or abandoned homes, as well as donate bank-owned properties to municipalities, nonprofit groups or land banks that accumulate properties for development. Communities have been eager to see these vacant homes sold, because they can bring down property values and attract crime, consumer groups say.

“Places like Detroit or Baltimore that really need to be creative about reshaping their city and dealing with blocks that have three or four houses on them could really benefit,” said Ira Rheingold, executive director of the National Association of Consumer Advocates.

Nearly half of the $4 billion in consumer aid will go to reducing the principal amount JPMorgan customers owe on their mortgages. The bank will also be credited $300 million for temporarily suspending the collection of mortgage payments to increase the odds that borrowers will be able to remain in their homes.

The remaining money will be used to lower interest rates on existing loans and provide low-income borrowers with new mortgages, which the bank is forbidden from selling to investors and forced to keep on its books to encourage responsible lending.

An independent monitor will supervise the consumer relief portion of the deal to ensure it is completed by the end of 2016. If JPMorgan fails to spend the entire $4 billion before that deadline, it will have to pay an amount equal to the unexpended funds either to the government or to a nonprofit organization designated by the government.

“Through this $13 billion resolution, we are demanding accountability and requiring remediation from those who helped create a financial storm that devastated millions of Americans,” Associate Attorney General Tony West said in a statement. “By requiring JPMorgan both to pay the largest penalty in history and provide needed consumer relief to areas hardest hit by the financial crisis, we rectify some of that harm.”

Like other banks, JPMorgan bundled hundreds of home loans into securities and marketed them as investments that could be traded like stocks. When homeowners defaulted on their mortgages in droves, the value of the securities plummeted and investors were saddled with huge losses. Government authorities subsequently launched probes into whether the banks misled investors about the risks and the quality of the securities.

As a part of the agreement, the bank has to acknowledge that it, along with its affiliates Bear Stearns and Washington Mutual, made false representations to investors. JPMorgan also admits that its employees knew that the loans in question did not comply with the bank’s guidelines and allowed them to be bundled and sold anyway.

“We are pleased to have concluded this extensive agreement,” Jamie Dimon, JPMorgan’s chief executive, said in a statement.

The bank could still face criminal charges, and if were not for the Justice deal, it would also be contending with separate lawsuits and investigations into its securities sales from attorneys general in Delaware, New York, Massachusetts, California and Illinois.

Collectively, the states will receive more than $1 billion in compensation, most of which will go toward restitution for pension funds that invested in the bad mortgage securities. Officials in Massachusetts said state prosecutors are still deciding what portion of the $34.4 million they received will help consumers.

New York Attorney General Eric Schneiderman said about $400 million of the over $1 billion the state received will be used to help families get legal counseling to navigate the foreclosure process, fund land banks and provide housing counseling for homeowners affected by Hurricane Sandy.

While the consumer aid will offer a lifeline to some JPMorgan borrowers, it provides nothing to borrowers who have already lost their homes. Even with the penalty tied to the deadline for disbursing the funding, there is no guarantee that the process will run smoothly, analysts said.

Yet the structure of the assistance, especially the efforts to curb blight, could set a standard for future settlements. Indeed, 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.

“The AGs and Justice are being as creative as they can with the tool of litigation, but the fact is you need comprehensive policy on how you deal with community development or infrastructure rebuilding,” Rheingold said.