President-elect Donald Trump has agreed to pay $25 million to settle lawsuits that claimed his now-defunct Trump University defrauded students, New York Attorney General Eric Schneiderman said Friday.

The settlement ends a dispute that dogged Trump throughout his presidential campaign and led to one of the more controversial moments: when he accused the judge overseeing two of the cases with being biased because he was of Mexican ancestry. 

Students who sued said they were lured by false promises into paying up to $35,000 to learn Trump's real estate investing "secrets" from his "hand-picked" instructors.

There were three lawsuits relating to Trump University: two class actions suits in California and a case brought by Schneiderman in New York. 

Schneiderman has said over 6,000 students across the country were defrauded out of millions.

"Donald Trump fought us every step of the way, filing baseless charges and fruitless appeals and refusing to settle for even modest amounts of compensation for the victims of his phony university," Schneiderman said in a statement released Friday. "Today, that all changes. Today's $25 million settlement agreement is a stunning reversal by Donald Trump and a major victory for the over 6,000 victims of his fraudulent university."

The settlement guarantees each victim will receive restitution, according to Schneiderman, who said Trump will also pay $1 million in penalties to New York for violating state education laws.

"The victims of Trump University have waited years for today's result, and I am pleased that their patience -- and persistence -- will be rewarded by this $25 million settlement," Schneiderman added.

Trump's attorneys could not immediately be reached for comment.

Trump has said he did not "hand pick" Trump University instructors, but that marketing language used was not to be taken literally. He has said most students gave the classes high ratings.

With Reuters