A customer uses a Bank of America ATM in Charlotte. (Chuck Burton/2009 ASSOCIATED PRESS PHOTO)

Bank of America agreed to settle claims it violated federal law by discriminating against mortgage applicants with disabilities, the Department of Justice said Friday.

The nation’s second-largest bank will pay up to $5,000 to borrowers who were asked to provide a letter from a doctor verifying their Social Security income and the severity of their disability.

It is unclear how many people were affected by these practices, but the bank has agreed to hire an outside auditor to review about 25,000 loan applications. The settle­ment covers disabled borrowers who applied for a loan between May 1, 2007, and April 30, 2012.

The case stems from three borrowers who filed complaints with the Department of Housing and Urban Development, which referred the matter to the Justice Department. Together, they will receive $125,000 in compensation.

“Loan applicants with disabilities should not be subjected to invasive requests for medical information from a doctor when they are applying for credit,” said Thomas E. Perez, assistant attorney general for the Justice Department’s civil rights division.

Bank of America admitted no wrongdoing, saying it settled the case to avoid costly litigation. Nevertheless, the bank has changed its documentation policies. It also agreed to improve the training of its loan officers and underwriters.

Still, the bank seemed indignant about the charges as officials accused the government of being “inconsistent” about whether a doctor’s note should be requested.

“HUD determined this policy is in compliance for its loans, yet suggests it somehow violates the Fair Housing Act for non-HUD loans,” the bank said in a statement. “Same statute, same alleged conduct, different result. We’re being accused of wrongdoing by the government for following a policy that the government approved.”

Justice Department officials maintain that there is no written guideline or regulation that requires a lender to obtain a letter from a doctor.

While this is the department’s first case dealing with Social Security income, it has engaged in a series of mortgage investigations in the aftermath of the housing crisis. The department has launched 1,452 mortgage fraud cases against 2,742 defendants since 2010 and secured 1,550 convictions.

“Justice has been much more aggressive since the financial crisis,” said Odette Williamson, an attorney at the National Consumer Law Center. “There may be more cases forthcoming as the enforcement agencies learn the full scope of the practices in the financial services industry.”

This case is the latest in a series of allegations that Bank of America, or its troubled ward, Countrywide Home Loans, mistreated homeowners.

In February, Bank of America was one of five banks involved in the Justice Department’s landmark $25 billion settlement over flawed and fraudulent foreclosure practices. The bank also ponied up $335 million in December 2011 to resolve federal claims that Countrywide charged black and Hispanic borrowers higher mortgage fees than white applicants.

Buying Countrywide and its troubled loan portfolio in 2008 has been a constant source of grief for Bank of America as it continues to fight legal battles stemming from the company’s unscrupulous practices.

Friday’s settlement, which requires court approval, was filed in federal court in Charlotte. News of the settlement had negligible effect on the bank’s shares, which closed up 1.6 percent to $9.55.