Wells Fargo, the nation's largest mortgage lender, has agreed to pay $175 million to settle allegations that independent brokers originating its loans charged higher fees and rates to minority borrowers than they did to white borrowers with similar credit risks, the Justice Department said Thursday.

If approved by federal court, it would be the second-largest settlement of a fair-lending investigation in department history. In December, Bank of America agreed to pay $335 million to settle a similar lawsuit over lending practices by Countrywide Financial, the failed lender it purchased in 2008.

Wells Fargo, which denied any wrongdoing, said it was settling the matter "solely for the purpose of avoiding contested litigation" with the Justice Department, and "to instead devote its resources to continuing to provide fair credit services and choices to eligible consumers, and important and meaningful assistance to borrowers in distressed U.S. real estate markets."

On its own initiative, the lender said that, as of Friday, it would discontinue funding mortgages that are originated, priced and sold by independent mortgage brokers not employed by Wells Fargo, who represent 5 percent of the lender's volume.

The settlement provides $125 million in compensation for borrowers who were steered into subprime mortgages or who paid higher fees and rates than white borrowers because of their race or national origin.

Wells Fargo will also provide $50 million in direct down-payment assistance to borrowers in communities around the country where the department identified large numbers of discrimination victims and which were hard hit by the housing crisis.

Statistical analyses have determined that nearly 30,000 African American and Hispanic borrowers in 82 regions of the country were victims of Wells Fargo practices, court documents said. As many as 1,030 Philadelphia-area borrowers could be eligible for a share of $2 million in damages, the Justice Department said.

The settlement stems from an investigation of Wells Fargo lending practices begun in 2009 by the Office of the Comptroller of the Currency, which determined that the lender engaged in discriminatory practices based on race or national origin, court documents show, steering African American borrowers disproportionately to subprime mortgages with higher-cost terms and a greater chance of default.

The Justice Department also had been investigating Wells Fargo since 2009. Its complaint alleges that African American and Hispanic wholesale borrowers paid more than non-Hispanic white wholesale borrowers, not based on borrower risk, but on race or national origin.

Wells Fargo's business practice allowed its loan officers and mortgage brokers to vary a loan's interest rate and other fees from the price it set based on the borrower's objective credit-related factors, the complaint shows.

In response to the proposed settlement, the Center for Responsible Lending said, "the impact of discriminatory pricing on African American and Latino communities has been severe and will take generations to remedy. We commend DOJ for pursuing this and other cases to address pricing discrimination and the steering of borrowers into bad home loans."

The proposed settlement provides for an independent administrator to contact and distribute payments of compensation at no cost to borrowers whom the Justice Department identifies as victims of Wells Fargo's discrimination.

The department will make a public announcement and post contact information on its website once an administrator is chosen. Borrowers who are eligible for compensation from the settlement will then be contacted by the administrator.

Individuals who believe that they may have been victims of lending discrimination by Wells Fargo and have questions about the settlement may e-mail the department at wellsfargo.settlement@usdoj.gov

Contact Alan J. Heavens at 215-854-2472, aheavens@phillynews.com or@alheavens at Twitter.