Wells Fargo & Co. has agreed to pay the City of Philadelphia $10 million to settle a federal lawsuit that alleged that the bank discriminated against minority borrowers — an issue that has gained more attention in recent years as studies and investigations have repeatedly found the barriers to fair housing that exist for minorities across the country.

The agreement, announced by the city Monday, resolves a 2017 lawsuit that Philadelphia brought against the San Francisco-based bank, which for years has been ranked as one of the largest in the region. Philadelphia alleged that Wells Fargo violated the Fair Housing Act by steering African American and Latino borrowers into mortgages that were riskier and more expensive than those offered to similarly situated white home-buyers. That, in turn, accelerated foreclosure and the number of abandoned properties, the complaint alleged, which “suppressed property values ... reduced the city’s property tax revenues, and increased the cost of providing municipal services.”

The lawsuit also alleged that Wells Fargo refused to extend credit to minority borrowers seeking to refinance their risky loans, or would instead refinance on less favorable terms than ones for loans issued to white borrowers.

As part of the settlement agreement, Wells Fargo did not admit liability. In a statement, the bank said it “strongly disputed the allegations made by the city in the lawsuit over Fair Housing Act claims.”

The $10 million agreement with the bank will be used to fund several existing city housing programs, officials said, all of which are targeted to promoting and preserving home ownership for low- and moderate-income residents. The settlement agreement also stipulates that Wells Fargo and the city will collaborate to conduct a program called “Understanding Philadelphia” for employees who work at Wells Fargo Home Mortgage in the area, which will “analyze the history of the housing market in [Philadelphia], the city’s diverse neighborhoods, and the current housing needs of city residents.”

Wells Fargo’s agreement with Philadelphia caps one part of a legal saga that has overshadowed the bank in recent years, as allegations of fraud and misconduct have swelled. Most notably, the bank has been dogged by a scandal that revealed that employees fraudulently opened millions of fake bank and credit card accounts to meet sales goals. For that, Wells Fargo has paid out hundreds of millions of dollars in settlements.

The 2017 lawsuit by Philadelphia was unrelated to Wells Fargo’s accounts scandal, though it did allege that the “systemic problems within Wells Fargo that enabled the unlawful sales practices to flourish” also “enabled Wells Fargo to engage in the longstanding pattern and practice of unlawful mortgage lending.” The city’s complaint alleged that Wells Fargo’s discrimination against minorities had been an issue since 2004 and found that, according to data, African American borrowers in Philadelphia with a credit score above 660 were nearly 2.6 times more likely to receive a more expensive or risky loan than a white borrower with similar characteristics. A Latino borrower, the lawsuit alleged, was nearly 2.1 times more likely.

Wells Fargo has faced similar allegations of discriminatory lending elsewhere. In 2012, the bank agreed to pay at least $175 million to settle federal allegations that it steered minorities into more expensive loans.

Allegations of racial discrimination in mortgage lending are nearly a century old — and have affected lenders beyond Wells Fargo, with the practice of “redlining,” or denying loans to certain neighborhoods, proliferating throughout much of the 1900s. Redlining eventually gave way to a practice called “reverse redlining,” in which residents in those neighborhoods were given access to credit, though many of the loans were risky.

Housing discrimination is illegal under the Fair Housing Act, which was passed more than five decades ago.

In a statement included in the city’s announcement, Joe Kirk, Wells Fargo’s region bank president for Greater Philadelphia, said the bank is “pleased that we’ve been able to resolve this matter in a way that will provide real, tangible sustainable home ownership opportunities for many low- and moderate-income residents of Philadelphia.”

City Solicitor Marcel S. Pratt said in a statement that the resolution will help direct “relief to the neighborhoods that were the subject of the litigation, which were communities of color that continue to face challenges.”

“The resolution will provide much-needed benefits to the city’s low- and moderate-income residents — most significantly by enabling home ownership, which is one of the most effective ways that families accumulate wealth in America,” Pratt continued.

According to officials, $8.5 million of the settlement will be used to provide grants for down-payment and closing cost assistance through a program called the Philly First Home Program, which launched this year. That program offers grants of up to $10,000 to assist first-time buyers or Philadelphians who have not owned a home in the last three years.

To qualify, a couple must make less than $86,520, and there is no requirement that the buyer must have received a loan from Wells Fargo. In October, the city said that 500 houses had been purchased using the program.

Additionally, city officials said, an additional $1 million from the agreement with Wells Fargo will be used toward the city’s Residential Mortgage Foreclosure Prevention Program, which aims to stave off foreclosure by pairing homeowners who are in default with housing counselors who attempt to negotiate loan modifications with lenders. As of last year, more than 11,000 homes had been saved by the program.

The remaining $500,000 from the settlement will be aimed at revitalizing vacant land through cleanup and greening efforts, the city said. Neither the city nor its lawyers will receive any of the settlement funds, Wells Fargo said.