Citigroup announced Monday that it had agreed to pay mortgage finance giant Fannie Mae $968 million to resolve claims on 3.7 million home loans that have soured or may go bad.

This is the latest win for Fannie Mae, which has been seeking compensation from banks that it claims misrepresented the quality of home loans sold to it during the housing boom. When the housing market crashed, homeowners defaulted on those faulty loans en masse, saddling Fannie with billions of dollars in losses.

The Citigroup agreement covers troubled loans and any potential future claims on mortgages made between 2000 and 2012 that were purchased by Fannie Mae. Most of the settlement amount is covered by Citigroup’s reserves, but the bank said it will set aside an additional $245 million.

“We have a strong and productive relationship with Fannie Mae,” Jane Fraser, chief executive of CitiMortgage, said in a statement. “As we work to deepen and enhance financial relationships with our clients, we will continue to focus on the production of high-quality mortgage loans.”

Citigroup is one of many lenders that sell home loans to Fannie Mae and its sister agency, Freddie Mac, which bundle them into mortgage-backed securities and cover the losses if a homeowner defaults. The mortgage finance companies have been asking banks to buy back some of the loans that went bad during the housing crisis.

This follows a deal Bank of America struck with Fannie Mae in January. Bank of America agreed to spend $6.7 billion to buy back about 30,000 troubled mortgages from Fannie at a discount from their original value. The bank also made $3.6 billion in cash payments to the government-owned mortgage giant. Bank of America struck a similar deal with Freddie Mac in 2011.

Fannie Mae and Freddie Mac have combed through millions of loans looking for shoddy underwriting to force mortgage lenders to buy them back. The pair have focused on mortgages issued between 2005 and 2008, a boom time in the housing market and a period that has led to a high number of delinquencies and defaults.

As of the end of March, Fannie said it had reviewed about 80 percent of the loans acquired during that period and expected to complete the process by the end of this year. It plans to issue repurchase requests to any bank that sold loans that were not up to par, including instances in which the lender failed to verify the borrower’s income or employment history.

“We continue to focus on making strong progress in resolving repurchase requests with lenders and remain committed to helping people to buy, refinance or rent a home,” Fannie’s general counsel, Bradley Lerman, said in a statement. The Citigroup agreement “resolves legacy repurchase issues, compensates taxpayers for losses, and allows Fannie Mae and Citi to move forward and strengthen our business relationship,” he said.

Since the government took control of Fannie and Freddie in 2008, the mortgage giants have been aggressively working to recoup losses, in part to repay the $188 billion they received in bailout funds. Last month, Fannie repaid $59.4 billion to the government.

It is unclear whether Freddie Mac is pursuing a similar action against Citi. Freddie Mac did not return requests for comment, and a Citi spokesman declined to comment on the matter.

The Federal Housing Finance Agency, which oversees Fannie Mae and Freddie Mac, has been waging a separate battle to recoup losses from allegedly fraudulent mortgage securities. Last month, Citigroup settled a suit filed by the FHFA for an undisclosed amount. The regulator has also settled with General Electric and is pursuing cases against 16 other banks.

The Citigroup agreement with Fannie comes a week after Sens. Bob Corker (R-Tenn.) and Mark R. Warner (D-Va.) introduced legislation to replace the mortgage finance giants with a new government agency that would shift more of the risks of mortgage lending to the private sector. The lawmakers are aiming to make the government the last line of defense in the event of a housing crash.

The bill, which is gaining bipartisan support, is the first substantial effort to redesign Fannie and Freddie since the housing crash and would force them to close their doors in five years.