After months of painstaking talks, government authorities and five of the nation’s biggest banks have agreed to a $26 billion settlement that could provide relief to nearly two million current and former American homeowners harmed by the bursting of the housing bubble, state and federal officials said. It is part of a broad national settlement aimed at halting the housing market’s downward slide and holding the banks accountable for foreclosure abuses.

Despite the billions earmarked in the accord, the aid will help a relatively small portion of the millions of borrowers who are delinquent and facing foreclosure. The success could depend in part on how effectively the program is carried out because earlier efforts by Washington aimed at troubled borrowers helped far fewer than had been expected.

Still, the agreement is the broadest effort yet to help borrowers owing more than their houses are worth, with roughly one million expected to have their mortgage debt reduced by lenders or able to refinance their homes at lower rates. Another 750,000 people who lost their homes to foreclosure from September 2008 to the end of 2011 will receive checks for about $2,000. The aid is to be distributed over three years.

An announcement was scheduled in Washington for Thursday morning. The final details of the pact, including how many states would participate, were expected to be announced then. The two biggest holdouts, California and New York, now plan to sign on, according to the officials with knowledge of the matter who did not want to be identified because the negotiations were not completed.