New Jersey will receive an estimated $837.7 million as part of a nationwide settlement announced this morning between the U.S. Department of Justice and five of the country’s largest mortgage servicers, according to the state's attorney general.

The vast majority of the payment, or $762 million, will provide direct relief to New Jersey homeowners, either in the form of loan modifications, refinancings or direct payments to those who lost their homes to foreclosure during the financial crisis, according to a statement from Attorney General Jeffrey Chiesa. The remaining $75.5 million will go to state to help it pay for various state housing progams, Chiesa said.

The accord is a part of a landmark $25 billion settlement between 49 states and financial institution, including Bank of America, Citigroup and Wells Fargo, and ends a long-running probe of abusive foreclosure practices, such as so-called robo-signing. JPMorgan Chase and Ally Financial also signed on to the agreement.

“This settlement is important because it will bring much-needed relief to New Jersey borrowers, and significant reform to the mortgage servicing industry,” Chiesa said in a statement. “Through the changes required by this settlement, we are putting a stop to the conduct that has harmed borrowers in the past and contributed to the mortgage problems in our state and across the country.”

The settlement has long been in the making, with the California and New York attorneys general reportedly considering pursuing their own suits against their banks. In the end, all states with the exception of Oklahoma joined the accord.

Chiesa said the state factored the servicers’ cooperation during the probe and their willingness to reform their business practices and mortgage loan servicing standards in its decision to join the nationwide agreement. “This settlement addresses breakdowns in the mortgage servicing industry, and allows us to pursue other mortgage-related misconduct,” he said.